Originally posted by A Kumar: Is junit good enough for unit testing of servlets?

No I believe not. Testing servlets is quite different from testing just plain Java classes as servlets needs to interact with the servlet container, and this is only possible while the container is running. Frameworks like Cactus (mentioned above) makes the job of testing servlets much easier.

There's so much to learn in this industry, and not everybody has the necessary interest.

A Kumar

Ranch Hand

Posts: 980

posted 10 years ago

Another option is to test without a container, by using mock objects in lieu of the javax.servlet.(http.)* classes.