From 9509710845bf8d8ef67755be7e097d540d43b026 Mon Sep 17 00:00:00 2001 From: rnveach Date: Sun, 11 Oct 2015 00:45:05 -0400 Subject: [PATCH] Issue #2161: unify test input locations --- .../checks/coding/NestedForDepthCheckTest.java | 13 +++++++++++-- .../{ => checks}/coding/InputNestedForDepth.java | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) rename src/test/resources/com/puppycrawl/tools/checkstyle/{ => checks}/coding/InputNestedForDepth.java (96%) diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java index 563be2dec..2889a7dab 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java @@ -21,6 +21,9 @@ package com.puppycrawl.tools.checkstyle.checks.coding; import static com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.MSG_KEY; +import java.io.File; +import java.io.IOException; + import org.apache.commons.lang3.ArrayUtils; import org.junit.Assert; import org.junit.Test; @@ -33,6 +36,12 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration; * @see NestedForDepthCheck */ public class NestedForDepthCheckTest extends BaseCheckTestSupport { + @Override + protected String getPath(String filename) throws IOException { + return super.getPath("checks" + File.separator + + "coding" + File.separator + filename); + } + /** * Call the check allowing 2 layers of nested for-statements. This * means the top-level for can contain up to 2 levels of nested for @@ -53,7 +62,7 @@ public class NestedForDepthCheckTest extends BaseCheckTestSupport { "44:13: " + getCheckMessage(MSG_KEY, 4, 2), }; - verify(checkConfig, getPath("coding/InputNestedForDepth.java"), + verify(checkConfig, getPath("InputNestedForDepth.java"), expected); } @@ -75,7 +84,7 @@ public class NestedForDepthCheckTest extends BaseCheckTestSupport { final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; - verify(checkConfig, getPath("coding/InputNestedForDepth.java"), + verify(checkConfig, getPath("InputNestedForDepth.java"), expected); } diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputNestedForDepth.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputNestedForDepth.java similarity index 96% rename from src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputNestedForDepth.java rename to src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputNestedForDepth.java index 347d96562..a0f04a7d1 100644 --- a/src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputNestedForDepth.java +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputNestedForDepth.java @@ -16,7 +16,7 @@ //License along with this library; if not, write to the Free Software //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// -package com.puppycrawl.tools.checkstyle.coding; +package com.puppycrawl.tools.checkstyle.checks.coding; /** * This Class contains no logic, but serves as test-input for the unit tests for the