Cleanup a test

This commit is contained in:
Clément Fournier
2020-03-22 05:07:23 +01:00
parent 961e78954a
commit 5067c79eb2
5 changed files with 32 additions and 46 deletions

View File

@ -26,6 +26,7 @@ import net.sourceforge.pmd.lang.LanguageRegistry;
import net.sourceforge.pmd.lang.java.JavaLanguageModule;
import net.sourceforge.pmd.lang.java.xpath.MetricFunction;
import net.sourceforge.pmd.lang.rule.XPathRule;
import net.sourceforge.pmd.lang.rule.xpath.XPathVersion;
/**
* @author Clément Fournier
@ -40,8 +41,7 @@ public class XPathMetricFunctionTest {
private Rule makeXpathRuleFromXPath(String xpath) {
XPathRule rule = new XPathRule();
rule.setXPath(xpath);
XPathRule rule = new XPathRule(XPathVersion.XPATH_2_0, xpath);
rule.setMessage(VIOLATION_MESSAGE);
rule.setLanguage(LanguageRegistry.getLanguage(JavaLanguageModule.NAME));
return rule;