[ 
https://jira.codehaus.org/browse/SUREFIRE-841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=307511#comment-307511
 ] 

Mikhail Mazursky commented on SUREFIRE-841:
-------------------------------------------

Also encountered this with surefire 2.12.3 and TestNG 6.7. Failure in 
@BeforeClass increments "Tests run".

{code}
public class RealTest  {
        
        @BeforeClass
        public void beforeClass() {
                assertThat(false).isTrue();
        }
        
        @Test
        public void test(){}
}
{code}

With failure it's output is
{noformat}
Tests run: 2, Failures: 1, Errors: 0, Skipped: 1
{noformat}

Without:
{noformat}
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
{noformat}
                
> 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
>
> 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

        

Reply via email to