struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oren Gross <ogr...@mercury.co.il>
Subject RE: [Mockobjects-java-users] MockStrutsTestCase error
Date Sun, 01 Sep 2002 14:02:34 GMT
Drop it! my silly mistake
sorry for the trouble
 
______________________________
Oren Gross, Software Developer
Mercury Interactive, APM - R&D
+972-3-5399407, ogross@mercury.co.il <mailto:ogross@mercury.co.il> 
 
<file:///C:/Documents%20and%20Settings/ogross/My%20Documents/My%20Pictures/l
ogo.gif> 

-----Original Message-----
From: Oren Gross [mailto:ogross@mercury.co.il]
Sent: Sunday, September 01, 2002 1:09 PM
To: Struts User (E-mail); Mockobjects Users (E-mail)
Subject: [Mockobjects-java-users] MockStrutsTestCase error


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