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

surefire-testng runs JUnit tests

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment