aspose file tools
The moose likes Struts and the fly likes Strutstestcase framework verifyForward(“success”) Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Strutstestcase framework verifyForward(“success”) Exception" Watch "Strutstestcase framework verifyForward(“success”) Exception" New topic
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Strutstestcase framework verifyForward(“success”) Exception
 
Similar Threads
testing Action class through StrutsTestCase
How do I set value in my test case method for testing Action Class?
StrutsTestCase-Problem with MockStrutsTestCase
testing a struts application i wan't to test a struts-application
does not contain handler parameter named 'method'. This may be caused by whitespace