At 12:26 PM 6/18/2001 -0500, Paus, Carissa wrote:
>Then please explain how to use option 1 on assumption 3 in the Architecture
>link on the cactus website
>
>ASSUMPTION 3:   "We need to call this servlet. Again 2 solutions : (1) open
>a browser and call the servlet URL or (2) write some java code that uses the
>URLConnection class to automatically call the servlet. This is what I call
>the client side part of Cactus. Of course the best solution is (2) for the
>following reasons :
>- The tests can be automated, i.e. it is possible to do automatic regression
>tests. See the eXtreme Programming philosophy for better understanding this.
>The rationale is : everytime you modify some piece of code, you run all the
>tests again to make sure everything is still working.
>- It is possible to verify the results returned by the Servlet : cookies,
>headers, ... By calling directly the Servlet URL in a browser, it is not
>possible to do so."

It sounds as though you are testing your servlets in a black-box 
functional-test fashion. As Vincent points out on the Cactus home page, 
that is not the point of Cactus. For such tests, you should use a framework 
like HttpUnit <http://www.httpunit.org>

Cactus is intended for white-box testing of servlets and JSPs.

Of course, your references to ServletContext make it sounds as though you 
are in fact doing some white-box testing, in which Cactus may be 
appropriate. If not, perhaps some more discussion will help us to guide 
you.  You may need to split up your testing, doing some in one fashion and 
some in another.

Reply via email to