Title: RE: Cactus Samples
Fabien,
Please try to look at the samples that are provided with the Cactus distribution. It will help as it does exactly what you're trying to achieve. You can also have a look at the documentation on the web site.
 
The short answer to your question: in your testXXX() method you have access to implicit object that you can pass to your method under test. These objects are or type HttpServletRequest, HttpServletResponse, ServletConfig, ...
 
Also in your example, you're using a 'req' variable that is not defined. So your example surely won't compile. Use the implicit "request" and "response" variables instead.
 
Hope it helps.
 
Thanks
Vincent
----- Original Message -----
Sent: Thursday, June 28, 2001 12:56 PM
Subject: RE: Cactus Samples

I Want to test a PageController servlet with only one method doFLow.
I make the following :




public void beginDoFlow(ServletTestRequest request){
        request.addParameter("NEXT","order/ord.jsp");
}

public void testDoFlow(){
        try{
        IsabelPageControllerTest  servlet = new IsabelPageControllerTest();
        String url = servlet.doFlow(req, resp);
        assertEquals(url,"/en/order/ord.jsp")   ;
        }
        catch(Throwable e){
                e.toString();
        }
}

but my method doFlow doesn't accept ServletTestRequest, i need to pass an HttpServletRequest.

Any Solution ?

Fabien

-----Original Message-----
From: Jari Worsley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 1:58 PM
To: [EMAIL PROTECTED]
Subject: Re: Cactus Samples


Fabien Lesire wrote:
>
> Hello,
>
>         Where can i find more samples and examples for Cactus ?
>
> Thanks,
>
> Fabien


at the moment there is only the sample application. getting that running
with junit/cactus/ant etc is a start.

if you want more on unit testing then try it's "spiritual home" at
junit.org :), there is a lot of good stuff there.

What is it you're trying to do?

Jari
--
Jari Worsley
Senior Programmer
Hyperlink Interactive Ltd

Reply via email to