01: package test.net.sourceforge.pmd.rules.design;
02:
03: import org.junit.Before;
04:
05: import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
06:
07: public class DesignRulesTest extends SimpleAggregatorTst {
08:
09: @Before
10: public void setUp() {
11: addRule("design", "AbstractClassWithoutAbstractMethod");
12: addRule("design", "AbstractClassWithoutAnyMethod");
13: addRule("design", "AccessorClassGeneration");
14: addRule("design", "AssignmentToNonFinalStatic");
15: addRule("design", "AvoidConstantsInterface");
16: addRule("design", "AvoidDeeplyNestedIfStmts");
17: addRule("design", "AvoidInstanceofChecksInCatchClause");
18: addRule("design", "AvoidProtectedFieldInFinalClass");
19: addRule("design", "AvoidReassigningParameters");
20: addRule("design", "AvoidSynchronizedAtMethodLevel");
21: addRule("design", "BadComparison");
22: addRule("design",
23: "ClassWithOnlyPrivateConstructorsShouldBeFinal");
24: addRule("design", "CloseResource");
25: addRule("design", "CompareObjectsWithEquals");
26: addRule("design", "DefaultLabelNotLastInSwitchStmt");
27: addRule("design", "EmptyMethodInAbstractClassShouldBeAbstract");
28: addRule("design", "EqualsNull");
29: addRule("design", "FinalFieldCouldBeStatic");
30: addRule("design", "IdempotentOperations");
31: addRule("design", "ImmutableField");
32: addRule("design", "InstantiationToGetClass");
33: addRule("design", "MissingBreakInSwitch");
34: addRule("design", "MissingStaticMethodInNonInstantiatableClass");
35: addRule("design", "NonCaseLabelInSwitchStatement");
36: addRule("design", "NonStaticInitializer");
37: addRule("design", "NonThreadSafeSingleton");
38: addRule("design", "OptimizableToArrayCall");
39: addRule("design", "PositionLiteralsFirstInComparisons");
40: addRule("design", "PreserveStackTrace");
41: addRule("design", "ReturnEmptyArrayRatherThanNull");
42: addRule("design", "SimpleDateFormatNeedsLocale");
43: addRule("design", "SimplifyBooleanExpressions");
44: addRule("design", "SimplifyBooleanReturns");
45: addRule("design", "SimplifyConditional");
46: addRule("design", "SingularField");
47: addRule("design", "SwitchDensity");
48: addRule("design", "SwitchStmtsShouldHaveDefault");
49: addRule("design", "UncommentedEmptyMethod");
50: addRule("design", "UnnecessaryLocalBeforeReturn");
51: addRule("design", "UnsynchronizedStaticDateFormatter");
52: addRule("design", "UseCollectionIsEmpty");
53: addRule("design", "UseLocaleWithCaseConversions");
54: addRule("design", "UseNotifyAllInsteadOfNotify");
55: addRule("design", "UseSingleton");
56: addRule("design", "TooFewBranchesForASwitchStatement");
57: // addRule("design", "TooManyHttpFilter.xml");
58:
59: }
60:
61: public static junit.framework.Test suite() {
62: return new junit.framework.JUnit4TestAdapter(
63: DesignRulesTest.class);
64: }
65: }
|