You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ravi Kulkarni <rk...@applabs.net> on 2004/02/05 13:47:13 UTC

STC - How Can I test multiple Actions in same method

Hi,

StrutsTestCase documentation says we can test multiple Actions in same method,
by calling setRequestPathInfo() and actionPerform() multiple times within the
same method. I am also calling clearRequestparameters() after every perform
method. But I am unable to execute the second Action.

Below is my code :

addRequestParameter("j_username", "rkulkarni");
        addRequestParameter("j_password", "webconnect");
        addRequestParameter("mode", "q1Ra04kE3cDo");
        setRequestPathInfo("/login");
        actionPerform(); // I am able to execute till here
        this.clearRequestParameters();

        setRequestPathInfo("/authenticateUser"); // unable to execute
        actionPerform();

        this.clearRequestParameters();

        setRequestPathInfo("/logout");
        actionPerform();
        this.verifyForward("logoutsuccess");
 }

TIA,

Ravi kulkarni.