You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Fabulich (JIRA)" <ji...@codehaus.org> on 2007/11/20 21:10:57 UTC

[jira] Created: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

TestNG @AfterSuite failures are ignored
---------------------------------------

                 Key: SUREFIRE-376
                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
             Project: Maven Surefire
          Issue Type: Bug
            Reporter: Dan Fabulich
         Attachments: testng-afterSuiteFailure.zip

Run the attached test, which includes a TestNG test like this:

public class TestNGSuiteTest {
	@Test public void doNothing() {}
	@AfterSuite public void failAfterSuite() { Assert.fail(); }
}

When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich updated SUREFIRE-376:
----------------------------------

    Priority: Critical  (was: Major)

> TestNG @AfterSuite failures are ignored
> ---------------------------------------
>
>                 Key: SUREFIRE-376
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>            Reporter: Dan Fabulich
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: testng-afterSuiteFailure.zip
>
>
> Run the attached test, which includes a TestNG test like this:
> public class TestNGSuiteTest {
> 	@Test public void doNothing() {}
> 	@AfterSuite public void failAfterSuite() { Assert.fail(); }
> }
> When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich updated SUREFIRE-376:
----------------------------------

    Component/s: TestNG support

> TestNG @AfterSuite failures are ignored
> ---------------------------------------
>
>                 Key: SUREFIRE-376
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>            Reporter: Dan Fabulich
>             Fix For: 2.4
>
>         Attachments: testng-afterSuiteFailure.zip
>
>
> Run the attached test, which includes a TestNG test like this:
> public class TestNGSuiteTest {
> 	@Test public void doNothing() {}
> 	@AfterSuite public void failAfterSuite() { Assert.fail(); }
> }
> When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_114407 ] 

Dan Fabulich commented on SUREFIRE-376:
---------------------------------------

One (better?) way to handle this would be to resolve SUREFIRE-384 and consume the TestNG output instead.

> TestNG @AfterSuite failures are ignored
> ---------------------------------------
>
>                 Key: SUREFIRE-376
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>            Reporter: Dan Fabulich
>             Fix For: 2.4
>
>         Attachments: testng-afterSuiteFailure.zip
>
>
> Run the attached test, which includes a TestNG test like this:
> public class TestNGSuiteTest {
> 	@Test public void doNothing() {}
> 	@AfterSuite public void failAfterSuite() { Assert.fail(); }
> }
> When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich closed SUREFIRE-376.
---------------------------------

    Resolution: Fixed

fixed in revision 597234

> TestNG @AfterSuite failures are ignored
> ---------------------------------------
>
>                 Key: SUREFIRE-376
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>            Reporter: Dan Fabulich
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: testng-afterSuiteFailure.zip
>
>
> Run the attached test, which includes a TestNG test like this:
> public class TestNGSuiteTest {
> 	@Test public void doNothing() {}
> 	@AfterSuite public void failAfterSuite() { Assert.fail(); }
> }
> When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich updated SUREFIRE-376:
----------------------------------

    Fix Version/s: 2.4

> TestNG @AfterSuite failures are ignored
> ---------------------------------------
>
>                 Key: SUREFIRE-376
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
>             Project: Maven Surefire
>          Issue Type: Bug
>            Reporter: Dan Fabulich
>             Fix For: 2.4
>
>         Attachments: testng-afterSuiteFailure.zip
>
>
> Run the attached test, which includes a TestNG test like this:
> public class TestNGSuiteTest {
> 	@Test public void doNothing() {}
> 	@AfterSuite public void failAfterSuite() { Assert.fail(); }
> }
> When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-376) TestNG @AfterSuite failures are ignored

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_114406 ] 

Dan Fabulich commented on SUREFIRE-376:
---------------------------------------

JUnit 4 handles @AfterClass failures as separate pseudo-testCases.  As a result, you get test multiplication, where "2" tests were apparently executed, but one failed.

{code:xml}
  <testcase time="0.015" name="testSetUp"/>
  <testcase time="0.015" name="BasicTest">
    <failure type="java.lang.AssertionError:">java.lang.AssertionError:
        at org.junit.Assert.fail(Assert.java:74)
        at org.junit.Assert.fail(Assert.java:81)
        at BasicTest.oneTimeTearDown(BasicTest.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.junit.internal.runners.ClassRoadie.runAfters(ClassRoadie.java:65)
        at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:40)
        at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:314)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:929)
</failure>
{code}


> TestNG @AfterSuite failures are ignored
> ---------------------------------------
>
>                 Key: SUREFIRE-376
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-376
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>            Reporter: Dan Fabulich
>             Fix For: 2.4
>
>         Attachments: testng-afterSuiteFailure.zip
>
>
> Run the attached test, which includes a TestNG test like this:
> public class TestNGSuiteTest {
> 	@Test public void doNothing() {}
> 	@AfterSuite public void failAfterSuite() { Assert.fail(); }
> }
> When you run "mvn test", the test will pass, but it should fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira