View Javadoc

    1   package net.sourceforge.pmd.lang.java.rule.junit;
    2
    3   import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
    4
    5   import org.junit.Before;
    6
    7
    8   public class JunitRulesTest extends SimpleAggregatorTst {
    9
    10      private static final String RULESET = "java-junit";
    11
    12      @Before
    13      public void setUp() {
    14          addRule(RULESET, "JUnitAssertionsShouldIncludeMessage");
    15          addRule(RULESET, "JUnitSpelling");
    16          addRule(RULESET, "JUnitStaticSuite");
    17          addRule(RULESET, "JUnitTestContainsTooManyAsserts");
    18          addRule(RULESET, "JUnitTestsShouldIncludeAssert");
    19          addRule(RULESET, "SimplifyBooleanAssertion");
    20          addRule(RULESET, "TestClassWithoutTestCases");
    21          addRule(RULESET, "UnnecessaryBooleanAssertion");
    22          addRule(RULESET, "UseAssertEqualsInsteadOfAssertTrue");
    23          addRule(RULESET, "UseAssertNullInsteadOfAssertTrue");
    24          addRule(RULESET, "UseAssertSameInsteadOfAssertTrue");
    25          addRule(RULESET, "UseAssertTrueInsteadOfAssertEquals");
    26      }
    27
    28      public static junit.framework.Test suite() {
    29          return new junit.framework.JUnit4TestAdapter(JunitRulesTest.class);
    30      }
    31  }