Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: Junit 4.x support
    • Labels:
      None
    • Complexity:
      Expert
    • Number of attachments :
      8

      Description

      I know this is a pretty sizable task. I just wanted to get it in the system now that 4.0 has officially been released. Hopefully this will generate some discussion about how 4.0 will be handled - mainly if it will require a completely seperate implemenation of surefire (keeping the same API so it can easily be used by the maven plugin), or if use of 4.0 will be made a configurable option of the current surefire.

      Here's some additional features I'd like to see:
      1. Ability to categorize tests. Unfortunately, 4.0 doesn't include an @Category annotation, or make category a parameter of @Test. However, the filtering mechanism provided by 4.0 is sufficent to support categories given the presense of such an annotation. I recommend putting the @Category annotation in a seperate module (surefire-annotations?) and build support for it into surefire. Hopefully the junit guys could be convinced to incorporate it in a later version.
      2. Similarly, support repeated tests via an @Repeated annotation. I'm not sure how easy this would be to do external to junit.

      1. SUREFIRE31_karl_maven-surefire-plugin.patch
        2 kB
        Karl M. Davis
      2. SUREFIRE31_karl_surefire_surefire-providers_surefire-junit_2ndMethod.patch
        5 kB
        Karl M. Davis
      3. SUREFIRE31_karl_surefire_surefire-providers_surefire-junit.patch
        21 kB
        Karl M. Davis
      4. SUREFIRE-31-maven-surefire-plugin.patch
        1 kB
        Bernd
      5. SUREFIRE-31-surefire-trunk.patch
        14 kB
        Bernd
      6. surefire-junit4.patch
        27 kB
        Tom Huybrechts
      7. surefire-junit4.patch
        24 kB
        Tom Huybrechts

        Issue Links

          Activity

          Hide
          Tom Huybrechts added a comment -

          I took Karls code and added it to the current surefire trunk. I moved the junit4 code to its own surefire-junit4 provider.
          SurefirePlugin.java is patched to use the new provider if a junit dependency with baseVersion.startsWith("4") is found.
          Since junit4 is backward compatible, both new-style (@Test) and old-style (extends TestCase) unit tests can be used in the same project.

          The old junit3 provider is not touched and it is still the default.

          Patch attached...

          Show
          Tom Huybrechts added a comment - I took Karls code and added it to the current surefire trunk. I moved the junit4 code to its own surefire-junit4 provider. SurefirePlugin.java is patched to use the new provider if a junit dependency with baseVersion.startsWith("4") is found. Since junit4 is backward compatible, both new-style (@Test) and old-style (extends TestCase) unit tests can be used in the same project. The old junit3 provider is not touched and it is still the default. Patch attached...
          Hide
          Tom Huybrechts added a comment -

          patch to the surefire trunk
          provides surefire-junit4 provider + patch for SurefirePlugin.java

          Show
          Tom Huybrechts added a comment - patch to the surefire trunk provides surefire-junit4 provider + patch for SurefirePlugin.java
          Hide
          Tom Huybrechts added a comment -

          previous patch was missing a pom...

          Show
          Tom Huybrechts added a comment - previous patch was missing a pom...
          Hide
          Jason van Zyl added a comment -

          Patches applied. Final form taken from Tom.

          Thanks.

          Show
          Jason van Zyl added a comment - Patches applied. Final form taken from Tom. Thanks.
          Hide
          Mike Youngstrom added a comment -

          Is it possible to run execute testNG, junit4, and junit3 tests together in the same project?

          Show
          Mike Youngstrom added a comment - Is it possible to run execute testNG, junit4, and junit3 tests together in the same project?

            People

            • Assignee:
              Jason van Zyl
              Reporter:
              John Didion
            • Votes:
              75 Vote for this issue
              Watchers:
              66 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: