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

Selecting multiple tests does not work when tests are inside parent class

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      I'm using TestNG to run tests with Maven Failsafe plugin version 2.21.0. I'm trying to follow instructions over at http://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html for running multiple tests in a single class:

      mvn -Dit.test=ITCircle#testOne+testTwo verify

      This works fine as long as testOne and testTwo are defined inside the class ITCircle. However, it does not work if ITCircle is a subclass of class ParentClass which holds the test methods. 

       

      So basically my structure is

      testpackage

        - ParentClass

            - public void setup

            - public void test1

            - public void test2

        - SubClass extends ParentClass

            - public void setup

       

      mvn -Dit.test=testpackage.ParentClass verify     - OK (2 tests ran)

      mvn -Dit.test=testpackage.ParentClass#test1+test2 verify     - OK (2 tests ran)

      mvn -Dit.test=testpackage.SubClass verify     - OK (2 tests ran)

      mvn -Dit.test=testpackage.SubClass#test1+test2 verify     - No tests found

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            buumi Jori

            Dates

              Created:
              Updated:

              Slack

                Issue deployment