forked from phoedos/pmd
Cleanup of test using reinitialization in XML test-data file
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4851 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -1,27 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||||
|
*/
|
||||||
|
package test.net.sourceforge.pmd.rules;
|
||||||
|
|
||||||
/**
|
import net.sourceforge.pmd.Rule;
|
||||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
|
||||||
*/
|
|
||||||
package test.net.sourceforge.pmd.rules;
|
public class LongVariableRuleTest extends SimpleAggregatorTst {
|
||||||
|
private Rule rule;
|
||||||
import net.sourceforge.pmd.Rule;
|
|
||||||
import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
|
public void setUp() {
|
||||||
import test.net.sourceforge.pmd.testframework.TestDescriptor;
|
rule = findRule("naming", "LongVariable");
|
||||||
|
}
|
||||||
public class LongVariableRuleTest extends SimpleAggregatorTst {
|
|
||||||
private Rule rule;
|
public void testAll() {
|
||||||
private TestDescriptor[] tests;
|
runTests(rule);
|
||||||
|
}
|
||||||
public void setUp() {
|
}
|
||||||
rule = findRule("naming", "LongVariable");
|
|
||||||
tests = extractTestsFromXml(rule);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAll() {
|
|
||||||
runTests(new TestDescriptor[] {tests[0], tests[1], tests[2], tests[3], tests[4]});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testThreshold() {
|
|
||||||
runTest(tests[5]); //Need a fresh rule to work around caching
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -65,7 +65,7 @@ public class Foo {
|
|||||||
}
|
}
|
||||||
]]></code>
|
]]></code>
|
||||||
</test-code>
|
</test-code>
|
||||||
<test-code>
|
<test-code reinitializeRule="true">
|
||||||
<description><![CDATA[
|
<description><![CDATA[
|
||||||
threshold test
|
threshold test
|
||||||
]]></description>
|
]]></description>
|
||||||
|
Reference in New Issue
Block a user