Servlet Unit

There are apparently four frameworks available for unit testing servlets:


Previous discussion (probably not worth keeping)

At the xUnit BOF at OOPSLA someone described unit tests for servlets. Could someone replace this text with more information?


I wasn't there, and I've not heard of anyone else doing it, but I have a testharness to allow JUnit to drive servlets. It's a set of classes that let you build "canned" queries, send them to the servlet, and examine the response. It's nowhere near complete, but it works well enough.


Just wanted to say thanks for this testharness. I've just started using it and it seems to work just perfectly. You say it's not complete - what would you say are the limitations or deficiencies? -- MattBiddulph

My observation: the code as provided doesn't work for the Servlet API version 2.2. A lot of methods also exist only as stubs in TestRequest? and TestResponse?. Still, it's the best thing I've seen for doing servlet unit tests, and these deficiencies can be easily corrected. -- BrettNeumeier


I am using jswdk1.0.1, but the testharness files contain implementation for tomcat. Is there any other code available for jswdk1.0.1?


Try these reachable links:


CategoryTesting


EditText of this page (last edited August 25, 2014) or FindPage with title or text search