Added a local variable test

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2243 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-09-08 18:57:15 +00:00
parent 5ea9e7033a
commit 70cd11bc18

View File

@ -11,6 +11,7 @@ public class VariableNamingConventionsRuleTest extends SimpleAggregatorTst {
new TestDescriptor(TEST2, "non-finals shouldn't have underscores", 1, new VariableNamingConventionsRule()),
new TestDescriptor(TEST3, "variables names should start with lowercase character", 1, new VariableNamingConventionsRule()),
new TestDescriptor(TEST4, "all is well", 0, new VariableNamingConventionsRule()),
new TestDescriptor(TEST5, "local finals are ok", 0, new VariableNamingConventionsRule()),
});
}
@ -34,4 +35,11 @@ public class VariableNamingConventionsRuleTest extends SimpleAggregatorTst {
" private int bar = 2;" + PMD.EOL +
" private static final int FOO_BAR = 2;" + PMD.EOL +
"}";
private static final String TEST5 =
"public class Foo {" + PMD.EOL +
" private void bar() {" + PMD.EOL +
" final int STATE_READING = 0;" + PMD.EOL +
" }" + PMD.EOL +
"}";
}