I have a cactus extension to test struts actions,  it is working well for
me.

It allows test like :

public void beginGoodKrogerCardNumber(WebRequest theRequest) {
        
theRequest.setURL(DomainStatics4JUnit.KROGER_HOST,URL_CONTEXT,PATH,"","");
        
theRequest.addParameter("usernameCardNumber",DomainStatics4JUnit.KROGER_EXIS
TING_CARD);
        theRequest.addParameter("password",DomainStatics4JUnit.PASSWORD);
        
        
        }
public void testGoodKrogerCardNumber()
        throws java.io.IOException, javax.servlet.ServletException,
javax.ejb.EJBException, StrutsWrappedException {
        
        ActionForward af =processCleanAction();

        assertActionForward("success",af);

        
}

I am trying to get permission to release it open source today.  I will keep
you posted.
R,
Nick

-----Original Message-----
From: Kevin Jones [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 12:09 AM
To: [EMAIL PROTECTED]
Subject: RE: Cactus and Struts


Struts does have servlets, well in fact it has one servlet that acts as the
controller. I've not tried this with Cactus (but am about to), can't you
send all the requests through the controller (as you're supposed to)?

Kevin Jones
Developmentor
www.develop.com

> -----Original Message-----
> From: Rotkop, Eugene [mailto:[EMAIL PROTECTED]]
> Sent: 23 October 2001 23:19
> To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> Subject: Cactus and Struts
>
>
> I am trying to use Cactus to test application built using Struts. The
> example provided with Cactus simply instantiates servlet
> (SampleServlet servlet = new SampleServlet();
>         servlet.doGet(request, response);)
> to test its functionality. In case of Struts, I cannot do this
> because with
> Struts application does not have servlets,
> but just special classes executed by Struts controller servlet.
> In this case is it possible to use "servlet testing" api of Cactus
> framework?
> If it is possible, could anyone provide an example. If not possible, what
> would be a good alternative?
>
> Thanks,
> Eugene Rotkop
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to