[
https://jira.codehaus.org/browse/SUREFIRE-841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=308587#comment-308587
]
Kristian Rosenvold commented on SUREFIRE-841:
---------------------------------------------
The behaviour you expect is compliant with a JUnit3 runner (and TestNG, which
up until just recently was only JUnit3 compliant). Surefire's behaviour is
consistent with JUnit4.
Ant is a JUnit3 based test-runner.
I'm still trying to figure out what to do with this issue:
A) Close it as wontfix.
B) Make surefire report JUnit3/TestNG style when using these libraries and
JUnit4 style when using junit4.
The problem with B is that surefire will appear to behave inconsistently when
users upgrade from 3.x to 4.x.
For those wishing to experiment with this, there is an IT project at:
https://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting
This verifies all the different modes of reporting.
> Incorrect Test Run Count
> ------------------------
>
> Key: SUREFIRE-841
> URL: https://jira.codehaus.org/browse/SUREFIRE-841
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Reporter: karthik kandasamy
> Fix For: 2.13
>
>
> When a simple Junit test with errors in the @Before() and @After() method are
> run directly with java or ant's junit task, it reports correctly that the
> Tests Run = 1 and Errors = 2.
> But when the same is run through maven surefire plugin, it reports it as
> Tests Run = 2 and Errors = 2.
> Its the same test in which 2 errors are encountered, so the Tests Run should
> be 1.
> I traced the issue to the org.apache.maven.surefire.report.TestSetRunListener
> Class - testError() method, where the completed count is also incremented
> along with the error count irrespective of whether its in the same test the
> error is encountered.
--
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