public void testPluginname() throws Throwable { Rule rule = new XPathRule(); rule.addProperty("xpath", "//VariableDeclaratorId[string-length(@Image) < 3]"); rule.setMessage("{0}"); rule.addProperty("pluginname", "true"); PMD p = new PMD(); RuleContext ctx = new RuleContext(); Report report = new Report(); ctx.setReport(report); ctx.setSourceCodeFilename("n/a"); RuleSet rules = new RuleSet(); rules.addRule(rule); p.processFile(new StringReader(TEST1), rules, ctx); RuleViolation rv = (RuleViolation) report.iterator().next(); assertEquals("a", rv.getDescription()); }