diff options
author | rnveach <rveach02@gmail.com> | 2015-10-15 20:15:07 -0400 |
---|---|---|
committer | Roman Ivanov <ivanov-jr@mail.ru> | 2015-10-15 18:10:48 -0700 |
commit | f0f26b9e91cde3e01f276c7f4194b8f6cf274aa6 (patch) | |
tree | cecbba9b2a8d1101a4c4f29b2717d449a0eaf05d /src/test/java | |
parent | 7e5e919ce7db115c5893fa23e07a3cf1acfc3f10 (diff) | |
download | checkstyle-f0f26b9e91cde3e01f276c7f4194b8f6cf274aa6.tar.gz |
Issue #2161: unify test input locations for sizes package
Diffstat (limited to 'src/test/java')
3 files changed, 30 insertions, 4 deletions
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java index c3393fbd5..b79ab58bb 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java @@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks.sizes; import static com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck.MSG_KEY; import static org.junit.Assert.assertArrayEquals; +import java.io.File; +import java.io.IOException; + import org.junit.Test; import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; @@ -34,6 +37,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; * @author Lars Kühne */ public class AnonInnerLengthCheckTest extends BaseCheckTestSupport { + @Override + protected String getPath(String filename) throws IOException { + return super.getPath("checks" + File.separator + + "sizes" + File.separator + filename); + } @Test public void testGetRequiredTokens() { diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java index 046848e32..2692c3219 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java @@ -21,10 +21,14 @@ package com.puppycrawl.tools.checkstyle.checks.sizes; import static com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.MSG_KEY; +import java.io.File; +import java.io.IOException; + import org.apache.commons.lang3.ArrayUtils; import org.junit.Test; import antlr.CommonHiddenStreamToken; + import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -32,6 +36,12 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; public class ExecutableStatementCountCheckTest extends BaseCheckTestSupport { + @Override + protected String getPath(String filename) throws IOException { + return super.getPath("checks" + File.separator + + "sizes" + File.separator + filename); + } + @Test public void testMaxZero() throws Exception { final DefaultConfiguration checkConfig = diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java index e2bf6fbd6..5d52d5080 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java @@ -26,6 +26,9 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.MSG_ import static com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.MSG_PUBLIC_METHODS; import static org.junit.Assert.assertArrayEquals; +import java.io.File; +import java.io.IOException; + import org.apache.commons.lang3.ArrayUtils; import org.junit.Test; @@ -34,6 +37,11 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.api.TokenTypes; public class MethodCountCheckTest extends BaseCheckTestSupport { + @Override + protected String getPath(String filename) throws IOException { + return super.getPath("checks" + File.separator + + "sizes" + File.separator + filename); + } @Test public void testGetRequiredTokens() { @@ -65,7 +73,7 @@ public class MethodCountCheckTest extends BaseCheckTestSupport { final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; - verify(checkConfig, getPath("sizes/MethodCountCheckInput.java"), expected); + verify(checkConfig, getPath("MethodCountCheckInput.java"), expected); } @Test @@ -90,7 +98,7 @@ public class MethodCountCheckTest extends BaseCheckTestSupport { "45: " + getCheckMessage(MSG_MANY_METHODS, 5, 3), }; - verify(checkConfig, getPath("sizes/MethodCountCheckInput.java"), expected); + verify(checkConfig, getPath("MethodCountCheckInput.java"), expected); } @Test @@ -105,7 +113,7 @@ public class MethodCountCheckTest extends BaseCheckTestSupport { "9: " + getCheckMessage(MSG_MANY_METHODS, 3, 2), }; - verify(checkConfig, getPath("sizes/MethodCountCheckInput2.java"), expected); + verify(checkConfig, getPath("MethodCountCheckInput2.java"), expected); } @Test @@ -118,6 +126,6 @@ public class MethodCountCheckTest extends BaseCheckTestSupport { "3: " + getCheckMessage(MSG_MANY_METHODS, 5, 2), }; - verify(checkConfig, getPath("sizes/MethodCountCheckInput3.java"), expected); + verify(checkConfig, getPath("MethodCountCheckInput3.java"), expected); } } |