I changed my MockStrutsTestCase to Cactus approach for Container testing, and I got the following results:
----------------------------------------------
I am running a CactusStrutsTestCase with JUnit's ServletTestRunner, and I am getting the following error (any ideas???) :
testSuccessfulAddCategory Error null
java.lang.NullPointerException
at servletunit.struts.Common.findForward(Common.java:234)
at servletunit.struts.Common.verifyForwardPath(Common.java:128)
at servletunit.struts.CactusStrutsTestCase.verifyForward(CactusStrutsTestCase.java:528)
at qa.test.org.cait.argyle.module.announcement.struts.action.TestAddCategoryAction.testSuccessfulAddCategory(TestAddCategoryAction.java:123)
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 org.apache.cactus.AbstractTestCase.runServerTest(AbstractTestCase.java:332)
at org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.java:235)
at org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:149)
at org.apache.cactus.server.AbstractWebTestController.dispatch87_handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):125)
at org.apache.cactus.server.AbstractWebTestController.around87_handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
at org.apache.cactus.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
at org.apache.cactus.server.ServletTestRedirector.dispatch113_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):123)
at org.apache.cactus.server.ServletTestRedirector.around113_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):109)
at org.apache.cactus.server.ServletTestRedirector.dispatch112_doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
at org.apache.cactus.server.ServletTestRedirector.around112_doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I changed my MockStrutsTestCase to Cactus approach for Container testing, and I got the following results:
----------------------------------------------
I am running a CactusStrutsTestCase with JUnit's ServletTestRunner, and I am getting the following error (any ideas???) :
testSuccessfulAddCategory Error null
java.lang.NullPointerException
at servletunit.struts.Common.findForward(Common.java:234)
at servletunit.struts.Common.verifyForwardPath(Common.java:128)
at servletunit.struts.CactusStrutsTestCase.verifyForward(CactusStrutsTestCase.java:528)
at qa.test.org.cait.argyle.module.announcement.struts.action.TestAddCategoryAction.testSuccessfulAddCategory(TestAddCategoryAction.java:123)
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 org.apache.cactus.AbstractTestCase.runServerTest(AbstractTestCase.java:332)
at org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.java:235)
at org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:149)
at org.apache.cactus.server.AbstractWebTestController.dispatch87_handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):125)
at org.apache.cactus.server.AbstractWebTestController.around87_handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
at org.apache.cactus.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
at org.apache.cactus.server.ServletTestRedirector.dispatch113_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):123)
at org.apache.cactus.server.ServletTestRedirector.around113_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):109)
at org.apache.cactus.server.ServletTestRedirector.dispatch112_doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
at org.apache.cactus.server.ServletTestRedirector.around112_doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Have you invoked setRequestPathInfo?
See http://sourceforge.net/tracker/index.php?func=detail&aid=769553&group_id=39190&atid=424565