Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-745

-Dtest supports multiple test classes but not multiple test methods

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.12.1
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Complexity:
      Intermediate
    • Number of attachments :
      6

      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

        Hide
        rainLee added a comment -

        oh,sorry,i have already used this feature in my own maven repository,so i changed the version.
        i'll revert this soon

        Show
        rainLee added a comment - oh,sorry,i have already used this feature in my own maven repository,so i changed the version. i'll revert this soon
        Hide
        Olivier Lamy added a comment -

        As I see only it test for junit 4.4: does that work with all junit 4.x versions ?

        Show
        Olivier Lamy added a comment - As I see only it test for junit 4.4: does that work with all junit 4.x versions ?
        Hide
        rainLee added a comment -

        update patch
        remove pom modification
        add junit48 integration test

        Show
        rainLee added a comment - update patch remove pom modification add junit48 integration test
        Hide
        Olivier Lamy added a comment - - edited

        fixed r1294568.
        Thanks !

        Show
        Olivier Lamy added a comment - - edited fixed r1294568. Thanks !
        Hide
        rainLee added a comment -

        my pleasure

        Show
        rainLee added a comment - my pleasure

          People

          • Assignee:
            Olivier Lamy
            Reporter:
            reid holmes
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: