use of net.sourceforge.pmd.lang.rule.XPathRule in project pmd by pmd.
the class PLSQLXPathRuleTest method testXPathRule2.
/**
* See https://sourceforge.net/p/pmd/bugs/1166/
*/
@Test
public void testXPathRule2() {
XPathRule rule = createRule("2.0");
rule.apply(Arrays.asList(node), ctx);
Assert.assertEquals(2, ctx.getReport().treeSize());
}
use of net.sourceforge.pmd.lang.rule.XPathRule in project pmd by pmd.
the class PLSQLXPathRuleTest method testXPathRule1.
/**
* See https://sourceforge.net/p/pmd/bugs/1166/
*/
@Test
public void testXPathRule1() {
XPathRule rule = createRule("1.0");
rule.apply(Arrays.asList(node), ctx);
Assert.assertEquals(2, ctx.getReport().treeSize());
}
use of net.sourceforge.pmd.lang.rule.XPathRule in project pmd by pmd.
the class PLSQLXPathRuleTest method createRule.
private XPathRule createRule(String version) {
XPathRule rule = new XPathRule("//PrimaryExpression");
rule.setLanguage(LanguageRegistry.getLanguage(PLSQLLanguageModule.NAME));
rule.setVersion(version);
rule.setMessage("Test Violation");
return rule;
}
Aggregations