Recycle the test cases of AvoidConstantsInInterface
This commit is contained in:
@ -30,6 +30,7 @@ public class DesignRulesTest extends SimpleAggregatorTst {
|
||||
addRule(RULESET, "CloseResource");
|
||||
addRule(RULESET, "CompareObjectsWithEquals");
|
||||
addRule(RULESET, "ConfusingTernary");
|
||||
addRule(RULESET, "ConstantsInInterface");
|
||||
addRule(RULESET, "ConstructorCallsOverridableMethod");
|
||||
addRule(RULESET, "DefaultLabelNotLastInSwitchStmt");
|
||||
addRule(RULESET, "EmptyMethodInAbstractClassShouldBeAbstract");
|
||||
@ -73,6 +74,5 @@ public class DesignRulesTest extends SimpleAggregatorTst {
|
||||
addRule(RULESET, "UseNotifyAllInsteadOfNotify");
|
||||
addRule(RULESET, "UseUtilityClass");
|
||||
addRule(RULESET, "UseVarargs");
|
||||
addRule(RULESET, "ConstantsInInterface");
|
||||
}
|
||||
}
|
||||
|
@ -61,4 +61,26 @@ public interface SomeInterfaceName {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>clear rule violation (from AvoidConstantsInInterface)</description>
|
||||
<expected-problems>2</expected-problems>
|
||||
<code><![CDATA[
|
||||
public interface Foo {
|
||||
public static final int FOO = 2;
|
||||
public static final String BAR = "bar";
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>ok (from AvoidConstantsInInterface)</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public interface Foo {
|
||||
public static final int FOO = 2;
|
||||
public void buz();
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
|
Reference in New Issue
Block a user