This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Webservice and JUnit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice and JUnit" Watch "Webservice and JUnit" New topic
Author

Webservice and JUnit

Bob Green
Ranch Hand

Joined: Feb 29, 2004
Posts: 93
I would like to know if JUnit is the right tool for testing webservices. I have a webservice and I create a JUnit class to test it. I can not understand why it takes forever and I mean forever to run the test suite. If anyone has any idea, please respond to this.

TIA.
Ravikanth Reddy Bapathi
Greenhorn

Joined: Apr 13, 2007
Posts: 29
You cannot use Junit to test the whole webservice, instead you can write junit test cases to test the individual methods of the service / test the operations of the service.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39543
    
  27
There are two approaches to testing a WS. Either you can test the individual service methods. That is trivial to do if the class that implements them has no dependencies on other classes, in particular not on a runtime WS engine. The other way is test a deployed WS by sending it a request and parsing the response. That depends on the WS being deployed somewhere, and could thus introduce network latencies.

Having said that, it's not clear from your post which of the two ways you're going. Can you be more specific?


Ping & DNS - updated with new look and Ping home screen widget
Bob Green
Ranch Hand

Joined: Feb 29, 2004
Posts: 93
Thank you so much for all your inputs. My webservice calls another webservice. One thing I forgot to mention in my previous note was my webservice has security on it. I tested my webservice with JUnit and as I said before it takes forever to run. Yesterday, I decided to remove the security on my webservice and gave it another try. Guess what, it did not take that long to run at all. I've used SSL for the security. I am wondering does this make any sense to any of you or am I doing something wrong.

I am confused....

TIA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webservice and JUnit
 
Similar Threads
JUnit in Action
Having problem when trying to run the junit to invoke a webservice
Testing webservice with JUnit
Junit test case for webservice consumed using weblogic
@Autowired not working in JUnit using spring 2.5