use of net.sourceforge.pmd.RuleWithProperties in project pmd by pmd.
the class AbstractRendererTst method testRuleWithProperties.
@Test
public void testRuleWithProperties() throws Exception {
DummyNode node = createNode(1);
RuleContext ctx = new RuleContext();
ctx.setSourceCodeFilename(getSourceCodeFilename());
Report report = new Report();
RuleWithProperties theRule = new RuleWithProperties();
theRule.setProperty(RuleWithProperties.STRING_PROPERTY_DESCRIPTOR, "the string value\nsecond line with \"quotes\"");
report.addRuleViolation(new ParametricRuleViolation<Node>(theRule, ctx, node, "blah"));
String rendered = ReportTest.render(getRenderer(), report);
assertEquals(filter(getExpectedWithProperties()), filter(rendered));
}
Aggregations