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

-Dtest supports multiple test classes but not multiple test methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.12.1, 2.19
    • None
    • None

    Description

      The -Dtest parameter is very handy for running a specific test class or test method. It also supports running multiple test classes. Unfortunately, it does not permit specifying running multiple test methods. It would be great if this were possible.

      The examples below are from the Apache Commons project.

      WORKS: Run multiple test classes:
      mvn test -Dtest=ImmutablePairTest,StopWatchTest

      WORKS: Run a specific test method:
      mvn test -Dtest=ImmutablePairTest#testBasic

      DOES NOT WORK:
      mvn test -Dtest=StopWatchTest#testStopWatchSimple,StopWatchTest#testStopWatchSimpleGet
      mvn test -Dtest=ImmutablePairTest#testBasic,StopWatchTest#testLang315

      Attachments

        1. SUREFIRE-745-v2.patch
          22 kB
          rainLee
        2. SUREFIRE-745.patch
          18 kB
          rainLee
        3. multipleMethods-v4.patch
          14 kB
          rainLee
        4. multipleMethods-v3.patch
          14 kB
          rainLee
        5. multipleMethods-v2.patch
          5 kB
          rainLee
        6. multipleMethods.patch
          10 kB
          rainLee

        Activity

          People

            tibordigana Tibor Digana
            rtholmes Reid Holmes
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: