This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Junits for SpringWebApplication which is running at a remote weblogic server??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Junits for SpringWebApplication which is running at a remote weblogic server???" Watch "Junits for SpringWebApplication which is running at a remote weblogic server???" New topic
Author

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

sundaresan ganapathy
Greenhorn

Joined: Oct 08, 2008
Posts: 23
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

Joined: Oct 18, 2000
Posts: 4121


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.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
sundaresan ganapathy
Greenhorn

Joined: Oct 08, 2008
Posts: 23
Thank you very much for the suggestions given,i will work on your points an get back to u.

Regards,
Sundar
Sathyapriya Subburaj
Greenhorn

Joined: Mar 31, 2011
Posts: 3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Junits for SpringWebApplication which is running at a remote weblogic server???
 
Similar Threads
Remote Debugging the Oracle Weblogic 10.3.3
Weblogic server Node Manager
node, node manager, admin server, and managed server
Portal and portlet in WebSphere and remote struts application in weblogic
Problem in copying file from server to client local machine folder