Jakub Berlinski created SUREFIRE-878:
----------------------------------------

             Summary: redirectTestOutputToFile is empty when text is written to 
output too early (SpringJUnit4ClassRunner)
                 Key: SUREFIRE-878
                 URL: https://jira.codehaus.org/browse/SUREFIRE-878
             Project: Maven Surefire
          Issue Type: Bug
          Components: Maven Surefire Plugin
    Affects Versions: 2.12, 2.11, 2.10
         Environment: tested on Windows XP + JDK 1.6.29 and Linux (2.6.32) JDK 
1.6.24, Maven 2.2.1
            Reporter: Jakub Berlinski
            Priority: Minor
         Attachments: RedirectTest-output.txt, redirect.zip

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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to