From 21ef1a30124764b93045798f941139823f3c72d2 Mon Sep 17 00:00:00 2001 From: Wouter Zelle Date: Thu, 30 Nov 2006 21:32:36 +0000 Subject: [PATCH] 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 --- .../pmd/rules/LongVariableRuleTest.java | 44 ++++++++----------- .../pmd/rules/xml/LongVariable.xml | 2 +- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/LongVariableRuleTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/LongVariableRuleTest.java index 23d265d841..bb59317d0f 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/LongVariableRuleTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/LongVariableRuleTest.java @@ -1,27 +1,19 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ +package test.net.sourceforge.pmd.rules; - /** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - package test.net.sourceforge.pmd.rules; - - import net.sourceforge.pmd.Rule; - import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst; - import test.net.sourceforge.pmd.testframework.TestDescriptor; - - public class LongVariableRuleTest extends SimpleAggregatorTst { - private Rule rule; - private TestDescriptor[] tests; - - 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 - } - } +import net.sourceforge.pmd.Rule; +import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst; + +public class LongVariableRuleTest extends SimpleAggregatorTst { + private Rule rule; + + public void setUp() { + rule = findRule("naming", "LongVariable"); + } + + public void testAll() { + runTests(rule); + } +} diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/xml/LongVariable.xml b/pmd/regress/test/net/sourceforge/pmd/rules/xml/LongVariable.xml index b22f4e5113..869abd8a2f 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/xml/LongVariable.xml +++ b/pmd/regress/test/net/sourceforge/pmd/rules/xml/LongVariable.xml @@ -65,7 +65,7 @@ public class Foo { } ]]> - +