diff --git a/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java b/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java index fc9beb640..1d1846f3d 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/AllTests.java @@ -1,5 +1,6 @@ package com.puppycrawl.tools.checkstyle; +import com.puppycrawl.tools.checkstyle.checks.GenericIllegalRegexpCheckTest; import junit.framework.Test; import junit.framework.TestSuite; diff --git a/src/tests/com/puppycrawl/tools/checkstyle/BaseCheckTestCase.java b/src/tests/com/puppycrawl/tools/checkstyle/BaseCheckTestCase.java index 64e0ef7a9..7fce2c3bd 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/BaseCheckTestCase.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/BaseCheckTestCase.java @@ -68,6 +68,12 @@ public abstract class BaseCheckTestCase return f.getCanonicalPath(); } + protected void verify(Configuration aConfig, String aFileName, String[] aExpected) + throws Exception + { + verify(createChecker(aConfig), aFileName, aFileName, aExpected); + } + protected void verify(Checker aC, String aFileName, String[] aExpected) throws Exception { diff --git a/src/tests/com/puppycrawl/tools/checkstyle/GenericIllegalRegexpCheckTest.java b/src/tests/com/puppycrawl/tools/checkstyle/checks/GenericIllegalRegexpCheckTest.java similarity index 72% rename from src/tests/com/puppycrawl/tools/checkstyle/GenericIllegalRegexpCheckTest.java rename to src/tests/com/puppycrawl/tools/checkstyle/checks/GenericIllegalRegexpCheckTest.java index 25377a080..dd5df97e3 100644 --- a/src/tests/com/puppycrawl/tools/checkstyle/GenericIllegalRegexpCheckTest.java +++ b/src/tests/com/puppycrawl/tools/checkstyle/checks/GenericIllegalRegexpCheckTest.java @@ -1,6 +1,7 @@ -package com.puppycrawl.tools.checkstyle; +package com.puppycrawl.tools.checkstyle.checks; -import com.puppycrawl.tools.checkstyle.checks.GenericIllegalRegexpCheck; +import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; +import com.puppycrawl.tools.checkstyle.DefaultConfiguration; public class GenericIllegalRegexpCheckTest extends BaseCheckTestCase @@ -12,11 +13,10 @@ public class GenericIllegalRegexpCheckTest final DefaultConfiguration checkConfig = createCheckConfig(GenericIllegalRegexpCheck.class); checkConfig.addAttribute("format", illegal); - final Checker c = createChecker(checkConfig); final String fname = getPath("InputSemantic.java"); final String[] expected = { "69: Line matches the illegal pattern '" + illegal + "'." }; - verify(c, fname, expected); + verify(checkConfig, fname, expected); } }