Adjust unit test to verify console encoding of XML formatter
This commit is contained in:
@ -149,6 +149,7 @@ public class PMDTaskTest extends AbstractAntTestHelper {
|
|||||||
|
|
||||||
executeTarget("testFormatterEncodingWithXMLConsole");
|
executeTarget("testFormatterEncodingWithXMLConsole");
|
||||||
String report = getOutput();
|
String report = getOutput();
|
||||||
assertTrue(report.contains("unusedVariableWithÜmlaut"));
|
assertTrue(report.startsWith("<?xml version=\"1.0\" encoding=\"windows-1252\"?>"));
|
||||||
|
assertTrue(report.contains("unusedVariableWithÜmlaut"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,13 @@
|
|||||||
<pmd encoding="cp1252">
|
<pmd encoding="cp1252">
|
||||||
<ruleset>java-unusedcode</ruleset>
|
<ruleset>java-unusedcode</ruleset>
|
||||||
<formatter type="xml" toConsole="true">
|
<formatter type="xml" toConsole="true">
|
||||||
<param name="encoding" value="UTF-8" /> <!-- report encoding -->
|
<!-- specifying a encoding here will override the console encoding.
|
||||||
|
The output might have junk characters in it.
|
||||||
|
|
||||||
|
<param name="encoding" value="UTF-8" />
|
||||||
|
|
||||||
|
The test doesn't specify the report encoding, so that the console/default encoding is used
|
||||||
|
-->
|
||||||
</formatter>
|
</formatter>
|
||||||
<fileset dir="${pmd.home}/src/test/resources/ant/java">
|
<fileset dir="${pmd.home}/src/test/resources/ant/java">
|
||||||
<include name="EncodingTestClass.java" />
|
<include name="EncodingTestClass.java" />
|
||||||
|
Reference in New Issue
Block a user