View Javadoc

    1   package net.sourceforge.pmd.lang.java.rule.controversial;
    2
    3   import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
    4
    5   import org.junit.Before;
    6
    7
    8   public class ControversialRulesTest extends SimpleAggregatorTst {
    9
    10      private static final String RULESET = "java-controversial";
    11
    12      @Before
    13      public void setUp() {
    14          addRule(RULESET, "AssignmentInOperand");
    15          addRule(RULESET, "AvoidLiteralsInIfCondition");
    16          addRule(RULESET, "AvoidPrefixingMethodParameters");
    17          addRule(RULESET, "AvoidUsingNativeCode");
    18          addRule(RULESET, "AvoidUsingShortType");
    19          addRule(RULESET, "AvoidUsingVolatile");
    20          addRule(RULESET, "AtLeastOneConstructor");
    21          addRule(RULESET, "AvoidFinalLocalVariable");
    22          addRule(RULESET, "BooleanInversion");
    23          addRule(RULESET, "CallSuperInConstructor");
    24          addRule(RULESET, "DataflowAnomalyAnalysis");
    25          addRule(RULESET, "DefaultPackage");
    26          addRule(RULESET, "DontImportSun");
    27          addRule(RULESET, "DoNotCallGarbageCollectionExplicitly");
    28          addRule(RULESET, "NullAssignment");
    29          addRule(RULESET, "OnlyOneReturn");
    30          addRule(RULESET, "OneDeclarationPerLine");
    31          addRule(RULESET, "SuspiciousOctalEscape");
    32          addRule(RULESET, "UnnecessaryConstructor");
    33          addRule(RULESET, "UnnecessaryParentheses");
    34          addRule(RULESET, "UseConcurrentHashMap");
    35          addRule(RULESET, "UseObjectForClearerAPI");
    36      }
    37
    38      public static junit.framework.Test suite() {
    39          return new junit.framework.JUnit4TestAdapter(ControversialRulesTest.class);
    40      }
    41  }