From 2f584ef4d5914dcb8a118d800be8b7df9913c511 Mon Sep 17 00:00:00 2001 From: rnveach Date: Mon, 12 Oct 2015 12:11:51 -0400 Subject: [PATCH] Issue #2161: unify test input locations --- .../checks/design/ThrowsCountCheckTest.java | 13 ++++++++++--- .../{ => checks}/design/InputThrowsCount.java | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) rename src/test/resources/com/puppycrawl/tools/checkstyle/{ => checks}/design/InputThrowsCount.java (96%) diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java index 08ab6083d..796e80cd8 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java @@ -25,6 +25,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import java.io.File; +import java.io.IOException; import org.junit.Test; @@ -36,6 +37,12 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; public class ThrowsCountCheckTest extends BaseCheckTestSupport { + @Override + protected String getPath(String filename) throws IOException { + return super.getPath("checks" + File.separator + + "design" + File.separator + filename); + } + @Test public void testDefault() throws Exception { DefaultConfiguration checkConfig = createCheckConfig(ThrowsCountCheck.class); @@ -47,7 +54,7 @@ public class ThrowsCountCheckTest extends BaseCheckTestSupport { "55:43: " + getCheckMessage(MSG_KEY, 5, 4), }; - verify(checkConfig, getPath("design" + File.separator + "InputThrowsCount.java"), expected); + verify(checkConfig, getPath("InputThrowsCount.java"), expected); } @Test @@ -59,7 +66,7 @@ public class ThrowsCountCheckTest extends BaseCheckTestSupport { "27:20: " + getCheckMessage(MSG_KEY, 6, 5), }; - verify(checkConfig, getPath("design" + File.separator + "InputThrowsCount.java"), expected); + verify(checkConfig, getPath("InputThrowsCount.java"), expected); } @Test @@ -101,6 +108,6 @@ public class ThrowsCountCheckTest extends BaseCheckTestSupport { "35:28: " + getCheckMessage(MSG_KEY, 5, 4), "55:43: " + getCheckMessage(MSG_KEY, 5, 4), }; - verify(checkConfig, getPath("design" + File.separator + "InputThrowsCount.java"), expected); + verify(checkConfig, getPath("InputThrowsCount.java"), expected); } } diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/design/InputThrowsCount.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputThrowsCount.java similarity index 96% rename from src/test/resources/com/puppycrawl/tools/checkstyle/design/InputThrowsCount.java rename to src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputThrowsCount.java index bfbb74aec..52f10ba20 100644 --- a/src/test/resources/com/puppycrawl/tools/checkstyle/design/InputThrowsCount.java +++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputThrowsCount.java @@ -1,4 +1,4 @@ -package com.puppycrawl.tools.checkstyle.design; +package com.puppycrawl.tools.checkstyle.checks.design; import java.awt.AWTException; import java.io.EOFException;