XML test reports are not well-formed when failure message contains quotes.
--------------------------------------------------------------------------
Key: MSUREFIRE-54
URL: http://jira.codehaus.org/browse/MSUREFIRE-54
Project: Maven 2.x Surefire Plugin
Type: Bug
Versions: 2.1.2
Environment: n/a
Reporter: Mike Whittemore
Attachments: TEST-bad.xml, TEST-good.xml, unittests.xsl
When a test fails, and the error message contains quotes, the surefire XML
report is not well-formed. The error message gets placed in the <failure>
element's 'message' attribute, which causes nested quotes if the message
contains any quotes. Error message quotes should be escaped I believe.
This may apply to other elements in the XML report.
I am using surefire plugin version 2.1.2 but it may affect other versions as
well.
Test Case:
It's not junit, but it may be helpful. I've attached two faked XML reports that
resemble real Maven2 XML surefire reports. The 'bad' one has a message with
quotes, the 'good' one does not. I used Xalan and an XSLT found in my
CruiseControl install to transform each one. The 'bad' one cannot be parsed.
The 'good' well-formed one can be parsed and successfully transformed. I've
also attached the XSLT. The commands to run the transforms follow:
java -cp <path to xalan jar> org.apache.xalan.xslt.Process -IN TEST-good.xml
-XSL unittests.xsl
java -cp <path to xalan jar> org.apache.xalan.xslt.Process -IN TEST-bad.xml
-XSL unitests.xsl
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]