Search in sources :

Example 16 with FooRule

use of net.sourceforge.pmd.FooRule in project pmd by pmd.

the class SuppressWarningsTest method testFieldLevelSuppression.

@Test
public void testFieldLevelSuppression() {
    Report rpt = new Report();
    runTestFromString(TEST6, new FooRule(), rpt, LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getVersion("1.5"));
    assertEquals(1, rpt.size());
}
Also used : FooRule(net.sourceforge.pmd.FooRule) Report(net.sourceforge.pmd.Report) Test(org.junit.Test)

Example 17 with FooRule

use of net.sourceforge.pmd.FooRule in project pmd by pmd.

the class SuppressWarningsTest method testSpecificSuppressionValue2.

@Test
public void testSpecificSuppressionValue2() {
    Report rpt = new Report();
    runTestFromString(TEST9_VALUE2, new FooRule(), rpt, LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getVersion("1.5"));
    assertEquals(1, rpt.size());
}
Also used : FooRule(net.sourceforge.pmd.FooRule) Report(net.sourceforge.pmd.Report) Test(org.junit.Test)

Example 18 with FooRule

use of net.sourceforge.pmd.FooRule in project pmd by pmd.

the class SuppressWarningsTest method testSpecificSuppressionMulitpleValues1.

@Test
public void testSpecificSuppressionMulitpleValues1() {
    Report rpt = new Report();
    runTestFromString(TEST9_MULTIPLE_VALUES_1, new FooRule(), rpt, LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getVersion("1.5"));
    assertEquals(0, rpt.size());
}
Also used : FooRule(net.sourceforge.pmd.FooRule) Report(net.sourceforge.pmd.Report) Test(org.junit.Test)

Example 19 with FooRule

use of net.sourceforge.pmd.FooRule in project pmd by pmd.

the class SuppressWarningsTest method testSpecificSuppression.

@Test
public void testSpecificSuppression() {
    Report rpt = new Report();
    runTestFromString(TEST9, new FooRule(), rpt, LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getVersion("1.5"));
    assertEquals(1, rpt.size());
}
Also used : FooRule(net.sourceforge.pmd.FooRule) Report(net.sourceforge.pmd.Report) Test(org.junit.Test)

Example 20 with FooRule

use of net.sourceforge.pmd.FooRule in project pmd by pmd.

the class SuppressWarningsTest method testInheritedSuppression.

@Test
public void testInheritedSuppression() {
    Report rpt = new Report();
    runTestFromString(TEST3, new FooRule(), rpt, LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getVersion("1.5"));
    assertEquals(0, rpt.size());
}
Also used : FooRule(net.sourceforge.pmd.FooRule) Report(net.sourceforge.pmd.Report) Test(org.junit.Test)

Aggregations

FooRule (net.sourceforge.pmd.FooRule)21 Report (net.sourceforge.pmd.Report)19 Test (org.junit.Test)18 RuleContext (net.sourceforge.pmd.RuleContext)4 ParametricRuleViolation (net.sourceforge.pmd.lang.rule.ParametricRuleViolation)4 DummyNode (net.sourceforge.pmd.lang.ast.DummyNode)3 ReportTest (net.sourceforge.pmd.ReportTest)2 HashMap (java.util.HashMap)1 ConfigurationError (net.sourceforge.pmd.Report.ConfigurationError)1 RuleViolation (net.sourceforge.pmd.RuleViolation)1 Node (net.sourceforge.pmd.lang.ast.Node)1