===========================================================
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.ejada.ipo.struts.actions.TestLoginAction.testFailedLogin(TestLoginAction.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
=============================================================
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got that too. The method getContextRelative() was deprecated in a previous version of Struts and is now no longer in 1.3.5., so no go with later version of Struts. I see there hasn't been an update in this project for almost three years, so I guess we can oficially call StrutsTestCase project dead. Sorry folks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using struts-core-1.3.5.jar and strutstest-2.1.3.jar,
I think it is a comptability problem, is there struts testcase that is compatible with struts 1.3.5 ??
here is my code:
========================
import servletunit.struts.MockStrutsTestCase;
public class TestLoginAction extends MockStrutsTestCase{
public TestLoginAction(String name) {
super(name);
}
public void testFailedLogin() {
setRequestPathInfo("/login");
addRequestParameter("userId","");
addRequestParameter("password","");
actionPerform();
verifyForward("fail");
}
}
I got this error:
===========================================================
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.ejada.ipo.struts.actions.TestLoginAction.testFailedLogin(TestLoginAction.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
=============================================================
I got that too. The method getContextRelative() was deprecated in a previous version of Struts and is now no longer in 1.3.5., so no go with later version of Struts. I see there hasn't been an update in this project for almost three years, so I guess we can oficially call StrutsTestCase project dead. Sorry folks.
So since this project is dead, what are people using now?