Testing Struts using MockStrutsTestcase
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   bala_subramanian
Posted On:   Monday, September 13, 2004 12:27 AM

I'm getting follwing error and failure while testing struts using Mock Struts test case Error ActionServlet - -null java.net.MalformedURLException: java.lang.NullPointerException MockStrutsTestCase - -Error initializing action servlet javax.servlet.ServletException: java.lang.NullPointerException failure: junit.framework.AssertionFailedError: Error initializing action servlet: Unable to find /WEB-INF/web.xml. TestCase is running from C:IBMworkspaceMovieTicketBooking directory. Context directory has not been set. Try calling setContextDirectory() with a relative or absolute path. /WEB-INF/web.xml must be found under the context directory, the directory the test case is running from, or in the classpath. at ju   More>>

I'm getting follwing error and failure while testing struts using Mock Struts test case
Error
ActionServlet - -null java.net.MalformedURLException: java.lang.NullPointerException
MockStrutsTestCase - -Error initializing action servlet javax.servlet.ServletException: java.lang.NullPointerException
failure:
junit.framework.AssertionFailedError: Error initializing action servlet: Unable to find /WEB-INF/web.xml. TestCase is running from C:IBMworkspaceMovieTicketBooking directory. Context directory has not been set. Try calling setContextDirectory() with a relative or absolute path. /WEB-INF/web.xml must be found under the context directory, the directory the test case is running from, or in the classpath.
at junit.framework.Assert.fail(Assert.java:47)
at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:342)
at servletunit.struts.MockStrutsTestCase.tearDown(MockStrutsTestCase.java:130)
at acc.movieticketbooking.test.TestLoginAction.tearDown(TestLoginAction.java:51)
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:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)

   <<Less
About | Sitemap | Contact