Invalid HTML generated by org.testng.reporters.jq.SuitePanel#generateMethod #199

atomicknight opened this Issue Mar 23, 2012 · 0 comments


None yet
1 participant

atomicknight commented Mar 23, 2012

Line 86 in SuitePanel adds the message from a Throwable to the generated HTML output without escaping reserved characters, which causes rendering issues when such characters are present in the message. For example, given this test:

package com.example;

public class Test {
    public void test1( ) { org.testng.Assert.assertFalse( true ); }

The generated output is:

<b>"expected:<false> but was:<true>"</b>

However, the correct output should be:

<b>"expected:&lt;false> but was:&lt;true>"</b>

The naive fix would probably look something like this:


But this should probably be generalized into a utility class or the like. commons-lang provides HTML escaping features that may be useful as inspiration for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment