Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-745

-Dtest supports multiple test classes but not multiple test methods

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.12.1, 2.19
    • Component/s: None
    • Labels:
      None
    • Environment:

      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

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

        Activity

          People

          • Assignee:
            Tibor Digana
            Reporter:
            Reid Holmes
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development