Error vs Failure
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vasyly_Giria
Posted On:   Tuesday, June 8, 2004 01:36 PM

I'm writing a simple MockStrutsTestCase and getting either an Error or a Failure. How does JUnit define the difference between these - Error vs Failure? 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 C:Eclipseworkspacemyproject directory. Context directory is C:Eclipseworkspacemyproject. struts config file must be found under the context directory, the directory the test case is running from, or in the classpath. Failure: junit.framework.AssertionFailedError: Error initializing action servlet: Unab   More>>

I'm writing a simple MockStrutsTestCase and getting either an Error or a Failure. How does JUnit define the difference between these - Error vs Failure?


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 C:Eclipseworkspacemyproject directory. Context directory is C:Eclipseworkspacemyproject. struts config file must be found under the context directory, the directory the test case is running from, or in the classpath.


Failure:

junit.framework.AssertionFailedError: Error initializing action servlet: Unable to find /WEB-INF/web.xml. TestCase is running from C:Eclipseworkspacemyproject directory. Context directory is C:EclipseworkspacemyprojectWEB-INF. /WEB-INF/web.xml must be found under the context directory, the directory the test case is running from, or in the classpath.


Vasyly

   <<Less

Re: Error vs Failure

Posted By:   Anonymous  
Posted On:   Wednesday, June 9, 2004 10:10 AM

A Failure is an assertion (a call to one of the assert* methods) that failed. It is indicated by throwing an AssertionFailedError. Every other Throwable thrown by your test method is registered as an Error. (I never found this distinction to be of any relevance, btw.)

Re: Error vs Failure

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, June 9, 2004 08:32 AM

Looking at your 2 examples, look at the 2 packages -- the "Error" comes from your "servletunit" package, while the "Failure" comes from "junit" ...

About | Sitemap | Contact