View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.java.rule.basic;
5   
6   import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
7   
8   import org.junit.Before;
9   
10  
11  public class BasicRulesTest extends SimpleAggregatorTst {
12  
13      private static final String RULESET = "java-basic";
14  
15      @Before
16      public void setUp() {
17          addRule(RULESET, "AvoidBranchingStatementAsLastInLoop");
18          addRule(RULESET, "AvoidDecimalLiteralsInBigDecimalConstructor");
19          addRule(RULESET, "AvoidMultipleUnaryOperators");
20          addRule(RULESET, "AvoidThreadGroup");
21          addRule(RULESET, "AvoidUsingHardCodedIP");
22  //        addRule(RULESET, "AvoidUsingHardCodedURL");
23          addRule(RULESET, "AvoidUsingOctalValues");
24          addRule(RULESET, "BigIntegerInstantiation");
25          addRule(RULESET, "BooleanInstantiation");
26          addRule(RULESET, "BrokenNullCheck");
27          addRule(RULESET, "CheckResultSet");
28          addRule(RULESET, "CheckSkipResult");
29          addRule(RULESET, "ClassCastExceptionWithToArray");
30          addRule(RULESET, "CollapsibleIfStatements");
31          addRule(RULESET, "DoubleCheckedLocking");
32          addRule(RULESET, "ExtendsObject");
33          addRule(RULESET, "ForLoopShouldBeWhileLoop");
34          addRule(RULESET, "JumbledIncrementer");
35          addRule(RULESET, "MisplacedNullCheck");
36          addRule(RULESET, "OverrideBothEqualsAndHashcode");
37          addRule(RULESET, "ReturnFromFinallyBlock");
38          addRule(RULESET, "DontCallThreadRun");
39          addRule(RULESET, "DontUseFloatTypeForLoopIndices");
40      }
41  
42      public static junit.framework.Test suite() {
43          return new junit.framework.JUnit4TestAdapter(BasicRulesTest.class);
44      }
45  }