Re: How to test a class that is started via a Servlet.



On Wed, 31 Oct 2007 10:06:43 -0700, Daniel Pitts wrote:

JUnit is for testing, and should NOT be used in production code to do
anything. By activating, do you mean invoking/calling? You could using
logging to show that its happening, or you could just assume that it
works because you've tested it appropriately.

I'm not sure I understood the initial question.

I'm having a problem testing some servlet code using JUnit as well and he
might be having the same issue. In my code I've had to separate the code
that uses the HttpServletRequest and HttpServletResponse classes to a
separate class, that remains untested, because JUnit always caused an
error when trying to test the class that contained these methods.

It would be nice to be able to test the servlet code as well. In my case
these are just thin wrappers around code that is tested, but it really
shouldn't have to be.

--
Kenneth P. Turvey <kt-usenet@xxxxxxxxxxxxxxxxxx>
.