struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oren Gross <ogr...@mercury.co.il>
Subject MockStrutsTestCase error
Date Sun, 01 Sep 2002 11:08:48 GMT
I am getting the following error with the simplest StrutsTestCase. Any
ideas?
//using struts 1.0.2
//using struts-testcase 1.6
 
public class AutoRedirectDbHandlerActionTest extends MockStrutsTestCase{
    ...
  public AutoRedirectDbHandlerActionTest(String testName) {
    super(testName);
  }
    ...
  public void setUp() throws Exception{
    super.setUp();
    setRequestPathInfo("redirectDb");
  }
  public void testPerformFailOnApplication() {
    addRequestParameter("application", null);
    addRequestParameter("target","dblist");
    actionPerform();
    verifyForward(REDIRECT_FAILS);
    assertEquals(ERROR_INVALID_APPLICATION,
getRequest().getAttribute(REDIRECT_ERROR));
  }
  public static void main(String[] args) {
    junit.textui.TestRunner.run(suite());
  }
}
 
 
testPerformFailOnApplication(com.mercury.topaz.admincenter.core.redirector.A
utoRedirectDbHandlerActionTest)
java.lang.NullPointerException
 at java.util.Hashtable.put(Hashtable.java:380)
 at
servletunit.HttpServletRequestSimulator.addParameter(HttpServletRequestSimul
ator.java:127)
 at
servletunit.struts.MockStrutsTestCase.addRequestParameter(MockStrutsTestCase
.java:270)
 at
com.mercury.topaz.admincenter.core.redirector.AutoRedirectDbHandlerActionTes
t.testPerformFailOnApplication(AutoRedirectDbHandlerActionTest.java:25)
 at java.lang.reflect.Method.invoke(Native Method)
 at junit.framework.TestCase.runTest(TestCase.java:156)
 at junit.framework.TestCase.runBare(TestCase.java:130)
 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:121)
 at junit.framework.TestSuite.runTest(TestSuite.java:157)
 at junit.framework.TestSuite.run(TestSuite.java:152)
 at junit.textui.TestRunner.doRun(TestRunner.java:74)
 at junit.textui.TestRunner.run(TestRunner.java:201)
 at
com.mercury.topaz.admincenter.core.redirector.AutoRedirectDbHandlerActionTes
t.main(AutoRedirectDbHandlerActionTest.java:33)
 
FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1
 
 
______________________________
Oren Gross, Software Developer
Mercury Interactive, APM - R&D
+972-3-5399407, ogross@mercury.co.il <mailto:ogross@mercury.co.il> 

 

Mime
View raw message