[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227925#action_227925 ]
Kristian Rosenvold edited comment on SUREFIRE-628 at 7/10/10 9:30 AM: ---------------------------------------------------------------------- Made a partial fix in r962846 Console output is now not discarded, The "static" output from a test run is output at the end, and in no particular order wrt the test methods. It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs. I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order. Anyone wishing to experiment with this can do the following: In directory: surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass Run commands tests like this: mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test You should be able to test & observe the effects of any patch ;) Deployed updated 2.6-SNAPSHOT was (Author: krosenvold): Made a partial fix in r962846 Console output is now not discarded, The "static" output from a test run is output at the end, and not in correct order. It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs. I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order. Anyone wishing to experiment with this can do the following: In directory: surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass Run commands tests like this: mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test You should be able to test & observe the effects of any patch ;) Deployed updated 2.6-SNAPSHOT > Parallel Execution: Output from junit.framework.TestListener.endTest() is > swallowed > ----------------------------------------------------------------------------------- > > Key: SUREFIRE-628 > URL: http://jira.codehaus.org/browse/SUREFIRE-628 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin > Environment: Windows/Cygwin, self-compiled version of the > surefire-plugin 2.6-SNAPSHOT > Reporter: Mag Hoehme > Attachments: surefire-output.tar.gz > > > I am using a junit.framework.TestListener to print some bookkeeping > information on System.out before and after the testcase. > When executed single-threaded, everything works fine, and I am getting both > messages before and after the testcase. In parallel, only the message before > the start of testcase is printed, while the message after the testcase > disappears. > ---------------------------------------------------------------------------------------- > Testcase output (single-threaded execution): both messages are printed > ---------------------------------------------------------------------------------------- > Running mho.SimpleSuiteTest > >>> starting testcase mho.SimpleSuiteTest > ### mho.SimpleSuiteTest:testError - ERROR > >>> finished testcase mho.SimpleSuiteTest, duration=0ms > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< > FAILURE! > Results : > Tests in error: > testError(mho.SimpleSuiteTest) > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 > ---------------------------------------------------------------------------------------- > Testcase output (parallel execution): second message is missing > ---------------------------------------------------------------------------------------- > Running mho.SimpleSuiteTest > >>> starting testcase mho.SimpleSuiteTest > ### mho.SimpleSuiteTest:testError - ERROR > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< > FAILURE! > Results : > Tests in error: > testError(mho.SimpleSuiteTest) > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira