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/21 04:24:57 UTC
[jira] Commented: (SUREFIRE-376) TestNG @AfterSuite failures are
ignored
[ 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