cyril vidal created SUREFIRE-818:
------------------------------------

             Summary: Ignored Tests in case of NullPointerException raised!
                 Key: SUREFIRE-818
                 URL: https://jira.codehaus.org/browse/SUREFIRE-818
             Project: Maven Surefire
          Issue Type: Bug
          Components: Maven Surefire Plugin
    Affects Versions: 2.11
            Reporter: cyril vidal
         Attachments: cyril.test.FirstTest.txt, cyril.test.IgnoredTest.txt, 
FirstTest.java, IgnoredTest.java, Message.java, MyServiceImpl.java, 
MyService.java, pom.xml

We have constated a VERY SERIOUS issue with maven surefire plugin from version 
2.8.1 to 2.11 (other no tested)
In some cases, if an error is raised during a test of a class, maven surefire 
plugin ignore it AND all subsequent tests in following test cases.
In our case, for month, we were thinking that all = 870 tests were running 
fine, however only 270 of them where running and all other (successfull or not 
were ignored!!!)
Detail: In case of using JMock framework when an unexpected invocation error is 
raised for whatever reason and that error raises itself a NullPointer exception 
by calling the hashCOde of the parameter of the method that JMock wants to 
display, then CURRENT and ALL SUBSEQUENT TESTS are ignored
Please find Enclosed a very simple sample with 2 tests (FirstTest and 
IgnoredTest) and the following output if the parameter of the method called has 
a hashCode method which throws NullPointerException:
{quote}
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running cyril.test.FirstTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec
Running cyril.test.IgnoredTest
My test is running fine
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] -----------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Fri Jan 13 21:43:47 GMT 2012
[INFO] Final Memory: 30M/350M
[INFO] -----------------------------------------------------------------------
{quote}

If we remove the NullPointerException in the hashCode method of Message object, 
than maven runs and reports correctly the two tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to