When you write a unit test you write it for a given method, which means you
have to ensure (as part of your test preconditions) that the environment is
correctly set up before calling your method. You'll do this either at the
beginning of each testXXX() method or if you want to execute the same init
before each testXXX() you can factorize it in a setUp() method that is
automatically called before each testXXX() (same as for JUnit)

Hope it helps.
Vincent

----- Original Message -----
From: "Vaishnav, Kunal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 3:54 PM
Subject: Cactus Query!


> Hello,
>   I had a query. I have created a class for testing some of my public
APIs.
> Now what I did is to define a class which extends HttpServlet..defined an
> init and service method, the method to test and doGet().
> In my test class, I defined the beginXX(), testXX() and endXX(). Now my
> query is how do I make sure that init and service method are called before
> each test case?.
>
> Thanks for your patience.
>
> Kunal.
>

Reply via email to