Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1211

surefire-testng runs JUnit tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.19
    • 2.19.1
    • Maven Surefire Plugin
    • None

    Description

      When running two test classes, one using JUnit and the other testng annotations, I observe surefire-testng running both tests:

      $ 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
      

      Instead it should only run the single testng test.

      Attachments

        1. pom.xml
          2 kB
          Andrew Gaul

        Activity

          People

            tibordigana Tibor Digana
            gaul Andrew Gaul
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: