Class SimpleAggregatorTst

java.lang.Object
net.sourceforge.pmd.test.RuleTst
net.sourceforge.pmd.test.SimpleAggregatorTst

public abstract class SimpleAggregatorTst extends RuleTst
Simple setup for a rule unit test, capable of testing multiple rules.

Override setUp() to register the rules, that should be tested via calls to addRule(String, String).

  • Constructor Details

    • SimpleAggregatorTst

      public SimpleAggregatorTst()
  • Method Details

    • setUp

      protected void setUp()
      Configure the rule tests to be executed. Override this method in subclasses by calling addRule, e.g.
      addRule("path/myruleset.xml", "CustomRule");
      Overrides:
      setUp in class RuleTst
      See Also:
    • addRule

      protected void addRule(String ruleSet, String ruleName)
      Add new XML tests associated with the rule to the test suite. This should be called from the setup method.
    • getRules

      protected List<net.sourceforge.pmd.lang.rule.Rule> getRules()
      Gets all configured rules.
      Overrides:
      getRules in class RuleTst
      Returns:
      all configured rules.