You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-dev@maven.apache.org by "Julian Wood (JIRA)" <ji...@codehaus.org> on 2005/11/26 00:40:07 UTC

[jira] Commented: (SUREFIRE-18) XML test report does not have quotes escaped in attribute values

    [ http://jira.codehaus.org/browse/SUREFIRE-18?page=comments#action_52026 ] 

Julian Wood commented on SUREFIRE-18:
-------------------------------------

I believe this is fixed in svn. I wrote a unit test to mimick the action of XMLReporter, and it correctly encodes the quotes. The code in question is in plexus-utils (org.codehaus.plexus.util.xml.Xpp3DomWriter). The fix appears to be in PrettyPrintXMLWriter.java, where quotes previously were not encoded for attributes.





> XML test report does not have quotes escaped in attribute values
> ----------------------------------------------------------------
>
>          Key: SUREFIRE-18
>          URL: http://jira.codehaus.org/browse/SUREFIRE-18
>      Project: surefire
>         Type: Bug
>     Versions: 1.4
>  Environment: Mac OS X 10.4.3, Java 1.4.2_09
>     Reporter: Jerry Charumilind
>     Assignee: Jason van Zyl

>
>
> When I run my tests using maven ('mvn test'), the XML test reports that are generated have an invalid element for the 'java.vm.vendor' property.  The Apple VM seems to set this to '"Apple Computer, Inc."' (note the double quotes).
> Here is a snippet from the generated test report, TEST-foo.FooTest.xml
> <?xml version="1.0" encoding="UTF-8" ?>
> <testsuite errors="0" tests="1" time="0.014" failures="0" name="foo.FooTest"
>   <properties>
>     <property value="Java(TM) 2 Runtime Environment, Standard Edition" name="jav
>     <property value="/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/
>     <property value="1.4.2-54" name="java.vm.version"/>
>     <property value="true" name="awt.nativeDoubleBuffering"/>
>     <property value="false" name="gopherProxySet"/>
>     <property value=""Apple Computer, Inc."" name="java.vm.vendor"/>
>     <property value="http://apple.com/" name="java.vendor.url"/>
>     <property value=":" name="path.separator"/>
>     <property value="Java HotSpot(TM) Client VM" name="java.vm.name"/>
>     <property value="sun.io" name="file.encoding.pkg"/>
> Note that the 'java.vm.vendor' element has double quotes inside the value instead of &quot;.  I believe that this is invalid.  I think that the line should instead read:
>     <property value="&quot;Apple Computer, Inc.&quot;" name="java.vm.vendor"/>
> I believe that the offending code is in XMLReporter where the property elements value is set.  I'm not sure if it is the responsibility of this code or the code in Xpp3Dom that should munge the double quotes.
> The end result of all of this is that my 'mvn site:site' throws lots of errors since the test report XML parsing fails for surefire reporting.

-- 
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