Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to test servlet using Junit test?

 
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: 42968
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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic