Inside HttpUnit there is the com.meterware.servletunit package that emulates a ServletContext and lets servlets run inside it and receive WebRequests. In my understanding it allows for unit testing of servlets as per point 2). Attila. > -----Original Message----- > From: Vincent Massol [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 23, 2001 2:29 PM > To: [EMAIL PROTECTED] > Subject: Servlet Unit Testing strategies > > > Hi Tomcat developers, > > I'd like to have your opinion on servlet unit testing. I have > written a > simple extension to JUnit called J2EEUnit to do that but I'd > like to knwo if > there is a general consensus on servlet unit testing, regarding it's > usefulness : > > Do you think : > > 1) It is useless. Just need to put a good facade in front of > your business > code and for the remaining part related to Servlets, > functional tests are > fine (using a tool such as HttpUnit), > > 2) It is nice to be able to unit test the part of the code related to > servlets (i.e. the controller in a MVC model).It is possible > to come up with > a tool to do that (ex: J2EEUnit) > > 3) With the current servlet API it is not possible to come up with a > framework that will let you properly do unit tests. It will > have lots of > shortcomings. The only solution is to extend the Servlet API > by our own > Servlet Test API. Then have Tomcat implement it. Once we have > this, it will > then be possible to create a tool/framework that make use of > this Test API > to unit test servlet. The next step will to promote this API > so that it > becomes a standard and other Servlet engine implement it. > > For point 3), are you aware of any project/discussion/JSR on > the subject ? > > Thanks a lot. > Vincent Massol > J2EEUnit author > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]