Hi,

I am getting a null pointer on some of my tests when I invoke actionPerform.

I've simplified the action classes and the test cases as much as possible but still I 
get the error. The error is repeatable on those tests that exhibit it.

Here is the stack track.

         [junit] Testcase: testLotsOfData took 0.741 sec
    [junit] Testcase: testAssertionFailedError took 0.761 sec
[java] 2002-03-14 17:16:26,636 DEBUG (BaseLog.java:189)- >getServiceName(...)
    [junit] Testcase: testExceptionNotSerializable took 0.711 sec
     [java] 2002-03-14 17:16:26,636 DEBUG (BaseLog.java:94)- Service to call = 
GET_RESULTS
     [java] 2002-03-14 17:16:26,636 DEBUG (BaseLog.java:199)- <getServiceName
    [junit] Testcase: testExceptionSerializable took 0.711 sec
        [java] 2002-03-14 17:16:26,636 DEBUG (BaseLog.java:189)- >doGetResults()
 [junit] Testcase: testIPLoginAction took 1.923 sec
    [junit]     Caused an ERROR
     [java] 2002-03-14 17:16:26,636 DEBUG (BaseLog.java:94)- Test Result = [Test 
failed, Exception m
essage = [null]]
     [java] 2002-03-14 17:16:26,716 DEBUG (BaseLog.java:199)- <doGetResults
    [junit] null
     [java] 2002-03-14 17:16:26,716 DEBUG (BaseLog.java:199)- <doPost
     [java] 2002-03-14 17:16:26,716 DEBUG (BaseLog.java:199)- <doPost
    [junit] java.lang.NullPointerException
    [junit]     at 
servletunit.struts.CactusStrutsTestCase.actionPerform(CactusStrutsTestCase.java:2
13)
    [junit]     at 
com.cisco.salesit.tests.ppm.struts.TestIPLoginAction.testIPLoginAction(TestIPLogi
nAction.java:95)
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at 
org.apache.cactus.AbstractTestCase.runServerTest(AbstractTestCase.java:491)
    [junit]     at 
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.java:456)
    [junit]     at 
org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.java:137)
    [junit]     at 
org.apache.cactus.server.AbstractTestController.handleRequest(AbstractTestControl
ler.java:122)
    [junit]     at 
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:
134)
    [junit]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    [junit]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [junit]     at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    [junit]     at org.apache.tomcat.core.Handler.service(Handler.java:287)
    [junit]     at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    [junit]     at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
    [junit]     at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
    [junit]     at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnec
tionHandler.java:213)
    [junit]     at 
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    [junit]     at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    [junit]     at java.lang.Thread.run(Thread.java:484)
    [junit]

 

The output when the test is invoked has a lot of nulls reported (not sure if this is 
an error)

     [java] 2002-03-14 17:16:25,024 DEBUG (BaseLog.java:189)- 
>getTestClassInstance([com.cisco.sales
it.tests.ppm.struts.TestIPLoginAction], [testIPLoginAction])
     [java] 2002-03-14 17:16:25,034 DEBUG (BaseLog.java:94)- Classloaders = 
AdaptiveClassLoader(  ),
 sun.misc.Launcher$AppClassLoader@71732b, sun.misc.Launcher$ExtClassLoader@7fdcde
     [java] 2002-03-14 17:16:25,034 DEBUG (BaseLog.java:189)- 
>getTestClassClass([com.cisco.salesit.
tests.ppm.struts.TestIPLoginAction])
     [java] 2002-03-14 17:16:25,294 DEBUG (BaseLog.java:199)- <getTestClassClass
     [java] 2002-03-14 17:16:25,294 DEBUG (BaseLog.java:199)- <getTestClassInstance
     [java] 2002-03-14 17:16:25,304 DEBUG (BaseLog.java:189)- 
>setTestCaseFields([testIPLoginAction(
com.cisco.salesit.tests.ppm.struts.TestIPLoginAction)])
     [java] 2002-03-14 17:16:25,304 DEBUG (BaseLog.java:189)- >loadFromRequest(...)
     [java] 2002-03-14 17:16:25,304 DEBUG (BaseLog.java:94)- URL = [host name = 
[null], port = [-1],
 context path = [null], servlet path = [null], path info = [null], query string = 
[null]]
     [java] 2002-03-14 17:16:25,314 DEBUG (BaseLog.java:189)- >loadFromRequest(...)

Thanks in anticipation

Alan Halley



---------------------------------
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage

Reply via email to