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, "AvoidFinalLocalVariable");
    16          addRule(RULESET, "AvoidLiteralsInIfCondition");
    17          addRule(RULESET, "AvoidPrefixingMethodParameters");
    18          addRule(RULESET, "AvoidUsingNativeCode");
    19          addRule(RULESET, "AvoidUsingShortType");
    20          addRule(RULESET, "AvoidUsingVolatile");
    21          addRule(RULESET, "AtLeastOneConstructor");
    22          addRule(RULESET, "AvoidFinalLocalVariable");
    23          addRule(RULESET, "BooleanInversion");
    24          addRule(RULESET, "CallSuperInConstructor");
    25          addRule(RULESET, "DataflowAnomalyAnalysis");
    26          addRule(RULESET, "DefaultPackage");
    27          addRule(RULESET, "DontImportSun");
    28          addRule(RULESET, "DoNotCallGarbageCollectionExplicitly");
    29          addRule(RULESET, "NullAssignment");
    30          addRule(RULESET, "OnlyOneReturn");
    31          addRule(RULESET, "OneDeclarationPerLine");
    32          addRule(RULESET, "SuspiciousOctalEscape");
    33          addRule(RULESET, "UnnecessaryConstructor");
    34          addRule(RULESET, "UnnecessaryParentheses");
    35          addRule(RULESET, "UseConcurrentHashMap");
    36          addRule(RULESET, "UseObjectForClearerAPI");
    37      }
    38
    39      public static junit.framework.Test suite() {
    40          return new junit.framework.JUnit4TestAdapter(ControversialRulesTest.class);
    41      }
    42  }