View Javadoc

1   package net.sourceforge.pmd.lang.java.rule.optimizations;
2   
3   import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
4   
5   import org.junit.Before;
6   
7   
8   public class OptimizationsRulesTest extends SimpleAggregatorTst {
9       
10      private static final String RULESET = "java-optimizations";
11  
12      @Before
13      public void setUp() {
14          addRule(RULESET, "AddEmptyString");
15          addRule(RULESET, "AvoidArrayLoops");
16          addRule(RULESET, "AvoidInstantiatingObjectsInLoops");
17          addRule(RULESET, "LocalVariableCouldBeFinal");
18          addRule(RULESET, "MethodArgumentCouldBeFinal");
19          addRule(RULESET, "RedundantFieldInitializer");
20          addRule(RULESET, "SimplifyStartsWith");
21          addRule(RULESET, "UnnecessaryWrapperObjectCreation");
22          addRule(RULESET, "UseArrayListInsteadOfVector");
23          addRule(RULESET, "UseArraysAsList");
24          addRule(RULESET, "UseStringBufferForStringAppends");
25          addRule(RULESET, "PrematureDeclaration");
26      }
27  
28      public static junit.framework.Test suite() {
29          return new junit.framework.JUnit4TestAdapter(OptimizationsRulesTest.class);
30      }
31  }