Merge branch 'wip-dogfood-test' into pmd/5.4.x

This commit is contained in:
Andreas Dangel
2015-10-05 09:29:21 +02:00
2 changed files with 14 additions and 1 deletions

View File

@ -3,6 +3,7 @@
*/
package net.sourceforge.pmd;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Test;
@ -29,4 +30,17 @@ public class RuleSetFactoryTest extends AbstractRuleSetFactoryTest {
Rule rule = ruleset.getRuleByName("UselessParentheses");
assertNull(rule);
}
/**
* Makes sure that the internal dogfood.xml ruleset is valid and doesn't reference any
* unknown rules.
* @throws RuleSetNotFoundException if dogfood couldn't be found at all
*/
@Test
public void testDogfoodRuleset() throws RuleSetNotFoundException {
RuleSetReferenceId ref = RuleSetReferenceId.parse("rulesets/internal/dogfood.xml").get(0);
RuleSetFactory ruleSetFactory = new RuleSetFactory();
RuleSet ruleset = ruleSetFactory.createRuleSet(ref);
assertNotNull(ruleset);
}
}