| Author |
Strutstestcase framework verifyForward(“success”) Exception
|
Laxman Chowdary
Greenhorn
Joined: Apr 11, 2012
Posts: 21
|
|
I'm using struts1.3.8 and spring jdbc. I wanted to perform unit testing using strutstestcase. It is providing some api also. I used in my Testing. I added the appropriate jars also.When i tried to run the unit test case it is getting failed when verifyForward("success"); But when i commented it and next running the test case it is getting executed. the snapshot of test case code is
public void testSuccessfulLogin() {
addRequestParameter("username", "struts");
addRequestParameter("password", "apache");
setRequestPathInfo("/LoginAction");
actionPerform();
verifyForward("success");
verifyForwardPath("/jsp/Success.jsp");
assertEquals("struts", getSession().getAttribute("authentication"));
verifyNoActionErrors();
}
The following Exception came.
java.lang.NoSuchMethodError: org.apache.struts.config.ForwardConfig.getContextRelative()Z
at servletunit.struts.Common.verifyForwardPath(Common.java:304)
at servletunit.struts.MockStrutsTestCase.verifyForward(MockStrutsTestCase.java:675)
at com.awpl.correspondence.test.LoginActionTest.testSuccessfulLogin(LoginActionTest.java:34)
So How to fix this issue??? Did i make any mistakes???
Thanks in Advance,
Laxman Chowdary
|
 |
 |
|
|
subject: Strutstestcase framework verifyForward(“success”) Exception
|
|
|