Hi All,
I am trying to write TestCase of example Specified in StrutsTestCase
which says that we can use both CactusStrutsTestCase or MockStrutsTestCase..
But when i am trying to run it it is giving error like this..
[main] INFO util.PropertyMessageResources - Initializing,
config='org.apache.struts.util.LocalStrings', returnNull=true
[main] INFO util.PropertyMessageResources - Initializing,
config='org.apache.struts.action.ActionResources', returnNull=true
Time: 0.625
There was 1 failure:
1)
testAction(logic.struts.actions.TestFirstAction)junit.framework.AssertionFai
ledError: Error running action.perform(): class
java.lang.NullPointerException - null
at
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:
339)
at logic.struts.actions.TestFirstAction.testAction(TestFirstAction.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at
com.intellij.rt.execution.junit.TextTestRunner.main(TextTestRunner.java:12)
FAILURES!!!
Tests run: 1, Failures: 1, Errors: 0
Process terminated with exit code -1
My Code is
package logic.struts.actions;
import servletunit.struts.MockStrutsTestCase;
import servletunit.struts.CactusStrutsTestCase;
import javax.servlet.ServletException;
public class TestFirstAction extends MockStrutsTestCase{
public TestFirstAction(String testName) { super(testName); }
public void testAction() {
setRequestPathInfo("/firstAction");
actionPerform();
verifyForward("second");
}
public void setUp() throws Exception {
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]