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

forkMode=pertest fails to call setUp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.5.1 (2.1.1 plugin)
    • 1.5.2 (2.1.2 plugin)
    • None
    • None
    • Maven 2.0.1 running maven-surefire-plugin 2.1.1

    Description

      The surefire plugin is failing to call the setUp method when forkMode=pertest. I will attach a very simple test project that will make it easy to verify this. Below is the 'trimmed' output if mvn -X -DforkMode=pertest test for the sample project. I suspect that the tearDown method is not getting called either but could not think of a simple way to verify that case for a 'pertest' configuration.

      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.1.1:test' -->
      [DEBUG] (f) basedir = /Users/brozow/tmp/surefire-sample
      [DEBUG] (f) childDelegation = true
      [DEBUG] (f) classesDirectory = /Users/brozow/tmp/surefire-sample/target/classes
      [DEBUG] (f) classpathElements = [/Users/brozow/tmp/surefire-sample/target/classes, /Users/brozow/tmp/surefire-sample/target/test-classes, /Users/brozow/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar]
      [DEBUG] (f) forkMode = pertest
      [DEBUG] (f) jvm = java
      [DEBUG] (f) localRepository = [local] -> file:///Users/brozow/.m2/repository
      [DEBUG] (f) pluginArtifacts = [junit:junit:jar:3.8.1, org.apache.maven.surefire:surefire-booter:jar:1.5, org.apache.maven.surefire:surefire:jar:1.5.1, org.codehaus.plexus:plexus-utils:jar:1.0.4, org.apache.maven:maven-plugin-api:jar:2.0, org.apache.maven:maven-artifact:jar:2.0]
      [DEBUG] (f) printSummary = true
      [DEBUG] (f) reportFormat = brief
      [DEBUG] (f) reportsDirectory = /Users/brozow/tmp/surefire-sample/target/surefire-reports
      [DEBUG] (f) testClassesDirectory = /Users/brozow/tmp/surefire-sample/target/test-classes
      [DEBUG] (f) useFile = true
      [DEBUG] – end configuration –
      [INFO] [surefire:test]

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      [surefire] Running com.example.SurefireTest
      [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.051 sec <<<<<<<< FAILURE !!

      Results :
      [surefire] Tests run: 1, Failures: 1, Errors: 0

      Attachments

        1. surefire-sample.zip
          1 kB
          Matt Brozowski

        Activity

          People

            carlos Carlos Sanchez Gonzalez
            brozow Matt Brozowski
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: