maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Digana (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SUREFIRE-1211) surefire-testng runs JUnit tests
Date Wed, 23 Dec 2015 21:13:46 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15070199#comment-15070199
] 

Tibor Digana commented on SUREFIRE-1211:
----------------------------------------

>>Compare the abridged test output with junit=false:
>>I expect surefire-testng to only run the testng tests (1 test).

Yes, remove both providers and use junit=false and you will see only TestNG tests in the entire
build summary.
The integration test proves this working.

Notice that we, first of all, discover providers in dependency structure. Then we run them
in a loop. They are undergo their individual tasks. Due to TestNG is able to run JUnit tests
just avoid surefire-junit47 or simply do not use any.

>>I expect surefire-testng to run both the JUnit and testng tests (3 tests).

No problem. This works so far 2.19.
Feel free to use TestNG 6.x which is dependent on JUnit 4.x. (optional - non-inheritable dependency)
and annotations can be used.

> surefire-testng runs JUnit tests
> --------------------------------
>
>                 Key: SUREFIRE-1211
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1211
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.19
>            Reporter: Andrew Gaul
>            Assignee: Tibor Digana
>             Fix For: 2.19.1
>
>         Attachments: pom.xml
>
>
> When running two test classes, one using JUnit and the other testng annotations, I observe
surefire-testng running both tests:
> {noformat}
> $ cat src/test/java/JunitTest.java 
> import org.junit.Test;
> public final class JunitTest {
>     @Test public void junitMethod() throws Exception {}
> }
> $ cat src/test/java/TestngTest.java 
> import org.testng.annotations.Test;
> public final class TestngTest {
>     @Test public void testngMethod() throws Exception {}
> }
> $ mvn clean test --quiet
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running JunitTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in JunitTest
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running TestSuite
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.476 sec - in TestSuite
> Results :
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
> {noformat}
> Instead it should only run the single testng test.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message