You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2004/05/14 16:17:45 UTC

RE: Help regarding running CactusStrutsTestCase

Hi Rajesh,

Please use the cactus-user mailing list and *NOT* the cactus-user-owner!
(I won't answer on that email next time. BTW, if you had used the
correct mailing list you would already have received answers several
days ago on your problem).

See below.

> -----Original Message-----
> From: Rajesh kumar singh [mailto:rajeshk@bsil.com]
> Sent: 04 May 2004 14:08
> To: cactus-user-owner@jakarta.apache.org
> Subject: Help regarding running CactusStrutsTestCase
> 
> 
>  Hi,
>          I am using cactus-12-1.5.jar,struts
1.0.jar,strutstest-2.0.0.jar
> and servlet.jar to run my CactusStrutsTestCase using ant.My test case
is
> 
> 
> public class TestLoginAction extends CactusStrutsTestCase
> {
> 	public TestLoginAction(String theName)
> {
>     super(theName);
> }
> public static Test suite()
> {
>     return new TestSuite(TestLoginAction.class);
> }
> public static void main(String args[])
>         {
>           junit.textui.TestRunner.run(suite());
>         }

Note that you can safely remove any of the previous 3 methods. They are
not needed.

> 	public void testSuccessfulLogin() {
> 				 setRequestPathInfo("/submit");
> 				 addRequestParameter("lastName","raj");
> 				 actionPerform();
> 				 verifyForward("success");
> 				 verifyNoActionErrors();
> 			}
> 
> 
> };
> 
> 
> While running it using ant,i am getting the following error
> 
> 
> org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
> results at   http://localhost:8080/myapp/ServletRedirector

[snip]

> org.apache.cactus.client.ParsingException: Not a valid response [404
> /myapp/ServletRedirector]

[snip]

Thus the error seems quite obvious: you have not mapped your
ServletRedirector correctly. It's not under /myapp/ServletRedirector.

> 
>                   If i remove commons-httpclient-2.0.jar from my
library,i
> get an AssertionFailedError message.I have looked for help on google
but
> nowhere could find the exact solution for it and so i am posting this
> question.It would be great if you help me out.Thanking you in advance.

-Vincent