more XML cleanups

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4844 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Wouter Zelle
2006-11-30 19:26:36 +00:00
parent 7c2f7bf62c
commit 71b693ba2d
2 changed files with 18 additions and 15 deletions

View File

@ -21,20 +21,14 @@
rule.addProperty("minimum", "10"); rule.addProperty("minimum", "10");
runTests(tests); runTests(tests);
} }
public void testReallyLongMethodWithLongerRange() throws Throwable {
rule.addProperty("minimum", "20");
runTest(new TestDescriptor(tests[1].getCode(),
"minimum with longer range", 0, rule));
}
/* /*
public void testOverrideMinimumWithTopScore() throws Throwable { public void testOverrideMinimumWithTopScore() throws Throwable {
Rule r = findRule("codesize", "ExcessiveMethodLength"); Rule r = findRule("codesize", "ExcessiveMethodLength");
r.addProperty("minimum", "1"); r.addProperty("minimum", "1");
r.addProperty("topscore", "2"); r.addProperty("topscore", "2");
Report rpt = new Report(); Report rpt = new Report();
runTestFromString(tests[4].getCode(), r, rpt); runTestFromString(tests[5].getCode(), r, rpt);
for (Iterator i = rpt.iterator(); i.hasNext();) { for (Iterator i = rpt.iterator(); i.hasNext();) {
RuleViolation rv = (RuleViolation)i.next(); RuleViolation rv = (RuleViolation)i.next();
assertTrue(rv.getLine() == 2 || rv.getLine() == 6); assertTrue(rv.getLine() == 2 || rv.getLine() == 6);

View File

@ -13,12 +13,7 @@ public class Foo {
} }
]]></code> ]]></code>
</test-code> </test-code>
<test-code> <code-fragment id="long"><![CDATA[
<description><![CDATA[
long
]]></description>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo { public class Foo {
public static void main(String args[]) { public static void main(String args[]) {
bar(); bar();
@ -34,7 +29,21 @@ public class Foo {
bar(); bar();
} // 11 lines - violation } // 11 lines - violation
} }
]]></code> ]]></code-fragment>
<test-code>
<description><![CDATA[
long, normal range
]]></description>
<expected-problems>1</expected-problems>
<code-ref id="long"/>
</test-code>
<test-code>
<description><![CDATA[
long, minimum with longer range
]]></description>
<rule-property name="minimum">20</rule-property>
<expected-problems>0</expected-problems>
<code-ref id="long"/>
</test-code> </test-code>
<test-code> <test-code>
<description><![CDATA[ <description><![CDATA[