Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-343

html escaping problems in xml reports

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0 (2.2 plugin)
    • Fix Version/s: 2.3.1
    • Component/s: xml generation
    • Labels:
      None

      Description

      Hi,

      I'm having some problems with the escaping of html specific characters (namely the < and >) in the surefire reports.

      The following example test:

         public void testShouldFail() throws Exception
          {
              fail("<html><body><h2> This Failed </h2></body></html>");
         }
      

      resulted in the following xml report

      <testcase time="0" name="testShouldFail">
          <failure type="junit.framework.AssertionFailedError" message="&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h2&amp;gt; This Failed &amp;lt;/h2&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;">
      junit.framework.AssertionFailedError: &amp;html&amp;&amp;body&amp;&amp;h2&amp; This Failed &amp;/h2&amp;&amp;/body&amp;&amp;/html&amp;
      	at junit.framework.Assert.fail(Assert.java:47)
      	at FailingTest.testShouldFail(FailingTest.java:7)
         </failure>
      </testcase>
      

      The text in the "message' attribute has been correctly escaped but the text within the <failure> tags seems to just have & for any of the html characters.

        Attachments

        1. SUREFIRE-343.patch
          0.6 kB
          Marat Radchenko

          Activity

            People

            • Assignee:
              brettporter Brett Porter
              Reporter:
              bmccoy Brydie McCoy
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: