This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junits for SpringWebApplication which is running at a remote weblogic server???

 
sundaresan ganapathy
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a doubt in debugging a SpringWebApplication running at a remote weblogic server.

is it possible to debug a SpringWebApplication running at a remote weblogic server? How to write a junit(from my local eclipse IDE)
to test the appln running remotely? because we cant deploy it locally,but its up and running in remote server,kindly help me out in
this.


Thanks,
Sundar

 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

is it possible to debug a SpringWebApplication running at a remote weblogic server?


Yes, as long as you are running a relatively recent version of Java and you can set the command-line options (and restart) the server you can remotely debug the application running on the server through Eclipse.


How to write a junit(from my local eclipse IDE) to test the appln running remotely?


You won't use JUnit by itself to do this - JUnit is just a unit testing framework - you'll need something that provides in-container testing (like Jakarta Cactus) or something that makes requests through the web frontend (like HttpUnit or Selenium ). However, I really wouldn't recommend this, because....


because we cant deploy it locally


1.) Why? I really can't visualize a good reason for this... Is the application specifically tied to Weblogic in some way, and you don't have enough licenses? Is it business/"security"/bureau"crazy" reasons?
2.) Unit tests shouldn't require a deployment anyway - and one of the big benefits of using Spring for DI/IOC is that your code is just a plain old java object, and can be tested in isolation outside of a "deployment only" container.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34671
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sundar,
While remote debugging is certainly possible, it is much faster and less error prone to test locally. Even if there is a WebLogic license shortage, why can't you deploy to Tomcat or JBoss locally. A nice thing about Dependency Injection is that you can inject stubs for any calls to the "outside world" (LDAP, WebLogic parts) that do not exist on your local machine. That way you know the bulk of the application works before deploying remotely.
 
sundaresan ganapathy
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the suggestions given,i will work on your points an get back to u.

Regards,
Sundar
 
Sathyapriya Subburaj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Am using oracle weblogic with Junit.Here am using my webapplication as jar and added in junit application.while running login testcase am not able to get the datasource and connection which is already registered or configured in server (oracle weblogic) its giving NullPointerException

Do you know how to get the datasource from server oracle weblogic

Thanks,
Sathya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic