Update ExcludeLinesTest
This commit is contained in:
@ -23,7 +23,7 @@ public class ExcludeLinesTest extends RuleTst {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
rule = findRule("java-unusedcode", "UnusedLocalVariable");
|
||||
rule = findRule("rulesets/testing/test-rset-3.xml", "PrintsVariableNames");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -49,12 +49,21 @@ public class ExcludeLinesTest extends RuleTst {
|
||||
assertEquals(r.getSuppressedRuleViolations().size(), 1);
|
||||
}
|
||||
|
||||
private static final String TEST1 = "public class Foo {" + PMD.EOL + " void foo() {" + PMD.EOL + " int x; //NOPMD "
|
||||
+ PMD.EOL + " } " + PMD.EOL + "}";
|
||||
private static final String TEST1 = "public class Foo {\n" +
|
||||
" void foo() {\n" +
|
||||
" int x; //NOPMD \n" +
|
||||
" } \n" +
|
||||
"}";
|
||||
|
||||
private static final String TEST2 = "public class Foo {" + PMD.EOL + " void foo() {" + PMD.EOL + " int x;"
|
||||
+ PMD.EOL + " } " + PMD.EOL + "}";
|
||||
private static final String TEST2 = "public class Foo {\n" +
|
||||
" void foo() {\n" +
|
||||
" int x;\n" +
|
||||
" } \n" +
|
||||
"}";
|
||||
|
||||
private static final String TEST3 = "public class Foo {" + PMD.EOL + " void foo() {" + PMD.EOL
|
||||
+ " int x; // FOOBAR" + PMD.EOL + " } " + PMD.EOL + "}";
|
||||
private static final String TEST3 = "public class Foo {\n" +
|
||||
" void foo() {\n" +
|
||||
" int x; // FOOBAR\n" +
|
||||
" } \n" +
|
||||
"}";
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
Ruleset used by test RuleSetReferenceIdTest
|
||||
</description>
|
||||
|
||||
<rule name="DummyRuleWithAViolationPerFile"
|
||||
<rule name="PrintsVariableNames"
|
||||
language="java"
|
||||
since="1.0"
|
||||
message="Violation from test-rset-3.xml: name {0}"
|
||||
|
Reference in New Issue
Block a user