Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Testing and the fly likes Junit error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Reply locked New topic
Author

Junit error

reena Mehta
Greenhorn

Joined: Nov 17, 2010
Posts: 24

hi
When i am running test-cases in junit
I got Error
servletunit.struts.ExceptionDuringTestError: A NullPointerException was thrown. This may indicate an error in your ActionForm, or it may indicate that the Struts ActionServlet was unable to find struts config file. TestCase is running from D:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\xbnp directory. Context directory has not been set. Try calling setContextDirectory() with a relative or absolute path. struts config file must be found under the context directory, the directory the test case is running from, or in the classpath.
at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:407)
at com.citi.cmb.gbnp.bdp.BenefitTestCases.test(BenefitTestCases.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)



please help me resolve this error
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
Since the other question has more details, I'll close this one.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Junit error
 
Similar Threads
servletunit.struts nullpointer problem
[Fatal Error] :1:1: Content is not allowed in prolog.
StrutsTestCase problem
Unit tetsing (Junit) Spring Framework
NULL Pointer Exception