Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to test servlet using Junit test?  RSS feed

 
Steve James
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know how to test an servlet class using Junit without using Cactus test . Is it possible to test a servlet using Junit without cactus test.Please tell me the process how to test a servlet using Junit test .


 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what exactly you want to test. For roundtrips tests to a web server or servlet container I recommend jWebUnit.

But you could also use a mock library (such as jmock or easymock) to create mock objects for the servlet-specific classes, and integrate the tests into your test suite that way.
 
Steve James
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ulf , valuable information . thank you .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!