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

redirectTestOutputToFile is empty when text is written to output too early (SpringJUnit4ClassRunner)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.10, 2.11, 2.12
    • 2.12.3
    • Maven Surefire Plugin
    • None
    • tested on Windows XP + JDK 1.6.29 and Linux (2.6.32) JDK 1.6.24, Maven 2.2.1

    Description

      I'm using a trivial test using SpringJUnit4ClassRunner (RedirectTest.java).

      The test prints a simple message to the standard output. I run the test with "mvn test" command.

      When log4j is configured to print some spring execution details (logger set to level INFO) the RedirectTest-output.txt file is empty.

      To reproduce:
      unzip "redirect.zip" file
      run "mvn test"
      confirm that the file target/surefire-reports/RedirectTest-output.txt is empty

      Optionally: edit pom.xml file, change maven-surefire-plugin version to 2.9 .
      run "mvn test"
      confirm that the file target/surefire-reports/RedirectTest-output.txt is not empty. See attached RedirectTest-output.txt captured using maven-surefire-plugin version 2.9.

      Attachments

        1. redirect.zip
          3 kB
          Jakub Berlinski
        2. RedirectTest-output.txt
          0.2 kB
          Jakub Berlinski

        Activity

          People

            krosenvold Kristian Rosenvold
            scypio Jakub Berlinski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: