[ 
https://issues.apache.org/jira/browse/SUREFIRE-1814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17150423#comment-17150423
 ] 

Dan Berindei commented on SUREFIRE-1814:
----------------------------------------

[~tibordigana] I only checked the console output, we actually set our console 
appender level to FATAL and rely on log files exclusively. We have a custom 
Log4j2 appender that routes each test's output to a different file, based on 
the thread name, and we set all thread names to include the test name.

However, I checked the output of the test project, and {{<system-out>}} 
includes both the message from the listener constructor and the one from the 
test itself:
{noformat}
    <system-out><![CDATA[a
 
1
ba 1b
]]></system-out>{noformat}
 

> Listener System.out.printf is written as multiple lines
> -------------------------------------------------------
>
>                 Key: SUREFIRE-1814
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1814
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 3.0.0-M4, 3.0.0-M5
>            Reporter: Dan Berindei
>            Priority: Major
>             Fix For: 3.0.0-M6
>
>
> Our project has a listener that writes progress information using ANSI escape 
> codes. Perhaps in order to avoid the output being captured by Surefire, it 
> saves {{System.out}} to a field in its constructor, and uses the saved 
> {{System.out}} reference to output progress information.
> Since 3.0.0-M4, surefire has started replacing {{System.out}} earlier, so now 
> it also captures the output of the listener. This wouldn't be a problem, 
> except the listener's {{printf()}} calls are now written across multiple 
> lines. E.g.
> {code:java}
> System.out.printf("a%2sb", "1");
> {code}
> prints this during a test:
> {noformat}
> a 1b
> {noformat}
> and this in the listener constructor:
> {noformat}
> a
>  
> 1
> b
> {noformat}
> I believe this is related to the POM using {{<parallel>classes</parallel>}} 
> and {{<forkCount>1</forkCount>}}. 
> Here is a small project reproducing the issue:
> https://github.com/danberindei/surefire-out-print-test



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to