maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Rosenvold (JIRA)" <j...@codehaus.org>
Subject [jira] (SUREFIRE-996) <system-out> and <system-err> content of junit xml report are not escaped
Date Thu, 18 Jul 2013 20:04:05 GMT

    [ https://jira.codehaus.org/browse/SUREFIRE-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=328955#comment-328955
] 

Kristian Rosenvold commented on SUREFIRE-996:
---------------------------------------------

You should test 2.16-SNAPSHOT, since we've had quite a few other reports of this and will
be releasing 2.16 "soon". let us know if your problem still applies to 2.16-SNAPSHOT
                
> <system-out> and <system-err> content of junit xml report are not escaped
> -------------------------------------------------------------------------
>
>                 Key: SUREFIRE-996
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-996
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.7+ (parallel) support
>    Affects Versions: 2.15
>         Environment: maven 3.0.4
> surefire 2.15-SNAPSHOT (from apache snashot repo)
>            Reporter: Julien Vermillard
>            Assignee: Kristian Rosenvold
>            Priority: Blocker
>             Fix For: 2.15
>
>         Attachments: 0001-added-test-case-for-SUREFIRE-996.patch, extended-test-case-for-SUREFIRE-996.patch
>
>
> Some of my junit xml report are not correctly generated :
> {code}
> <system-out>15:24:59.565 [pool-1-thread-5] INFO  c.s.a.i.c.s.api.PartnerServicesUtils
- Profile <null> 
> </system-out>
> {code}
> The < and > in "<null>" are not escaped.
> If I look at maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
> code, I think the bug is here :
> {code}
>         addOutputStreamElement( outputStreamWriter, fw, eos, ppw, report.getStdout(),
"system-out" );
>         addOutputStreamElement( outputStreamWriter, fw, eos, ppw, report.getStdErr(),
"system-err" );
>         ppw.endElement(); // test element
>     }
>     private void addOutputStreamElement( OutputStreamWriter outputStreamWriter, OutputStream
fw, EncodingOutputStream eos, XMLWriter xmlWriter, DeferredFileOutputStream stdOut,
>                                          String name )
>     {
>         if ( stdOut != null && stdOut.getByteCount() > 0 )
>         {
>             xmlWriter.startElement( name );
>             try
>             {
>                 xmlWriter.writeText( "" ); // Cheat sax to emit element
>                 outputStreamWriter.flush();
>                 stdOut.close();
>                 stdOut.writeTo( eos );
>                 eos.flush();
>             }
>             catch ( IOException e )
>             {
>                 throw new ReporterException( "When writing xml report stdout/stderr",
e );
>             }
>             xmlWriter.endElement();
>         }
>     }
> {code}
> and probably introduced by this commit : 
> commit 33e110fc46aa43d10b38a93b3db74c09be6bc6d5
> Author: Kristian Rosenvold <krosenvold@apache.org>
> Date:   Thu May 2 20:53:27 2013 +0200
>     [SUREFIRE-938] Removed memory binding for stdout/stderr capture.

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

Mime
View raw message