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

Maven runs suite() methods of all junit 3.x tests for each unit test even when forkMode is set to always

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.2
    • 2.7
    • JUnit 3.x support
    • None
    • Windows XP, Java 1.6
      Doesn't seem like an environment specific issue

    Description

      When running unit tests, if a project has junit 3 unit tests, and the pom has forkMode set to always, like so
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.4.2</version>
      <configuration>
      <disableXmlReport>true</disableXmlReport>
      <forkMode>always</forkMode>
      </configuration>
      </plugin>

      the unit test runner invokes the suite() method of all the junit 3 unit tests, even though they will not be run within the specific fork of thats running just one unit tests. This can be confusing and may cause issues if the unit tests were doing some @BeforeClass style initializations in the suite() method. Moreover this may be inefficient.

      Attachments

        Activity

          People

            krosenvold Kristian Rosenvold
            anshulj anshul
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: