use of net.sourceforge.pmd.FooRule in project pmd by pmd.
the class XMLRendererTest method createRuleViolation.
private static RuleViolation createRuleViolation(String description) {
DummyNode node = new DummyNode(1);
node.testingOnlySetBeginLine(1);
node.testingOnlySetBeginColumn(1);
node.testingOnlySetEndLine(1);
node.testingOnlySetEndColumn(1);
RuleContext ctx = new RuleContext();
ctx.setSourceCodeFilename("n/a");
return new ParametricRuleViolation<Node>(new FooRule(), ctx, node, description);
}
use of net.sourceforge.pmd.FooRule in project pmd by pmd.
the class XSLTRendererTest method testDefaultStylesheet.
@Test
public void testDefaultStylesheet() throws Exception {
XSLTRenderer renderer = new XSLTRenderer();
Report report = new Report();
DummyNode node = new DummyNode(1);
node.testingOnlySetBeginLine(1);
node.testingOnlySetBeginColumn(1);
RuleViolation rv = new ParametricRuleViolation<Node>(new FooRule(), new RuleContext(), node, "violation message");
report.addRuleViolation(rv);
String result = ReportTest.render(renderer, report);
Assert.assertTrue(result.contains("violation message"));
}
use of net.sourceforge.pmd.FooRule in project pmd by pmd.
the class SummaryHTMLRendererTest method createEmptyReportWithSuppression.
private Report createEmptyReportWithSuppression() {
Report rep = new Report();
Map<Integer, String> suppressions = new HashMap<>();
suppressions.put(1, "test");
rep.suppress(suppressions);
RuleContext ctx = new RuleContext();
ParametricRuleViolation<Node> violation = new ParametricRuleViolation<>(new FooRule(), ctx, null, "suppress test");
violation.setLines(1, 1);
rep.addRuleViolation(violation);
return rep;
}
use of net.sourceforge.pmd.FooRule in project pmd by pmd.
the class AbstractRendererTst method newRuleViolation.
private RuleViolation newRuleViolation(int endColumn) {
DummyNode node = createNode(endColumn);
RuleContext ctx = new RuleContext();
ctx.setSourceCodeFilename(getSourceCodeFilename());
return new ParametricRuleViolation<Node>(new FooRule(), ctx, node, "blah");
}
use of net.sourceforge.pmd.FooRule in project pmd by pmd.
the class SuppressWarningsTest method testSpecificSuppressionValue3.
@Test
public void testSpecificSuppressionValue3() {
Report rpt = new Report();
runTestFromString(TEST9_VALUE3, new FooRule(), rpt, LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getVersion("1.5"));
assertEquals(1, rpt.size());
}
Aggregations