aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorrnveach <rveach02@gmail.com>2015-10-19 12:07:07 -0400
committerRoman Ivanov <ivanov-jr@mail.ru>2015-10-19 21:55:24 -0700
commitf47587c9fb66cf46fbd2eb5691449cda6d551ecb (patch)
tree018ffdcab040aba9aa2301c44f66ddae0834972b /src/test/java
parent9c488c1f512ffcc58af433842c992bd3f85b2d63 (diff)
downloadcheckstyle-f47587c9fb66cf46fbd2eb5691449cda6d551ecb.tar.gz
Issue #2161: unify test input locations for checks package
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java7
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java10
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java84
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java10
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java8
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java5
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java15
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java13
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java7
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java8
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java8
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java9
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java7
-rw-r--r--src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java2
14 files changed, 135 insertions, 58 deletions
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java
index 0d4ffffc9..bd3211b56 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java
@@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import java.io.File;
+import java.io.IOException;
+
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
@@ -30,6 +33,10 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class ArrayTypeStyleCheckTest
extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
@Test
public void testGetRequiredTokens() {
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java
index 048df8ea7..aefd5a9f0 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java
@@ -21,6 +21,9 @@ package com.puppycrawl.tools.checkstyle.checks;
import static org.junit.Assert.assertArrayEquals;
+import java.io.File;
+import java.io.IOException;
+
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
@@ -28,9 +31,13 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class AvoidEscapedUnicodeCharactersCheckTest extends BaseCheckTestSupport {
-
private final String msg = getCheckMessage("forbid.escaped.unicode.char");
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
@Test
public void testGetRequiredTokens() {
AvoidEscapedUnicodeCharactersCheck checkObj =
@@ -186,5 +193,4 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends BaseCheckTestSupport
int[] expected = {TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL };
assertArrayEquals(expected, actual);
}
-
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java
index 933ce1e50..b0827ad18 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java
@@ -25,6 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.DescendantTokenCheck.MSG_KE
import static com.puppycrawl.tools.checkstyle.checks.DescendantTokenCheck.MSG_KEY_SUM_MIN;
import java.io.File;
+import java.io.IOException;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Test;
@@ -33,13 +34,18 @@ import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
public class DescendantTokenCheckTest extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
@Test
public void testDefault()
throws Exception {
final DefaultConfiguration checkConfig =
createCheckConfig(DescendantTokenCheck.class);
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -53,7 +59,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
final String[] expected = {
"17:12: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "LITERAL_NATIVE", "LITERAL_NATIVE"),
};
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -68,7 +74,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
final String[] expected = {
"17:12: Using 'native' is not allowed.",
};
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -82,7 +88,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
final String[] expected = {
"8:9: " + getCheckMessage(MSG_KEY_MIN, 1, 2, "LITERAL_SWITCH", "LITERAL_DEFAULT"),
};
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -95,7 +101,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
checkConfig.addAttribute("maximumNumber", "0");
checkConfig.addAttribute("minimumDepth", "3");
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -108,7 +114,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
checkConfig.addAttribute("maximumNumber", "0");
checkConfig.addAttribute("maximumDepth", "1");
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -123,22 +129,22 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
checkConfig.addAttribute("maximumMessage", "Empty statement.");
final String[] expected = {
+ "7:7: Empty statement.",
"12:7: Empty statement.",
- "17:7: Empty statement.",
- "22:19: Empty statement.",
- "26:10: Empty statement.",
- "29:16: Empty statement.",
- "33:10: Empty statement.",
- "43:10: Empty statement.",
- "49:13: Empty statement.",
- "51:13: Empty statement.",
- "54:19: Empty statement.",
- "58:10: Empty statement.",
- "61:9: Empty statement.",
- "66:10: Empty statement.",
- "72:10: Empty statement.",
- "76:10: Empty statement.",
- "80:10: Empty statement.",
+ "17:19: Empty statement.",
+ "21:10: Empty statement.",
+ "24:16: Empty statement.",
+ "28:10: Empty statement.",
+ "38:10: Empty statement.",
+ "44:13: Empty statement.",
+ "46:13: Empty statement.",
+ "49:19: Empty statement.",
+ "53:10: Empty statement.",
+ "56:9: Empty statement.",
+ "61:10: Empty statement.",
+ "67:10: Empty statement.",
+ "71:10: Empty statement.",
+ "75:10: Empty statement.",
};
verify(checkConfig, getPath("InputEmptyStatement.java"), expected);
@@ -158,7 +164,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"17:9: switch without \"default\" clause.",
};
- verify(checkConfig, getPath("checks/InputMissingSwitchDefault.java"), expected);
+ verify(checkConfig, getPath("InputMissingSwitchDefault.java"), expected);
}
@Test
@@ -176,7 +182,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"12:20: Literal Strings should be compared using equals(), not '=='.",
"17:22: Literal Strings should be compared using equals(), not '=='.",
};
- verify(checkConfig, getPath("checks" + File.separator + "InputStringLiteralEquality.java"), expected);
+ verify(checkConfig, getPath("InputStringLiteralEquality.java"), expected);
}
@Test
@@ -194,7 +200,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"11:18: Using 'POST_DEC' is not allowed.",
"12:18: Using 'POST_INC' is not allowed.",
};
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -210,7 +216,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
final String[] expected = {
"17:12: Using 'LITERAL_NATIVE' is not allowed.",
};
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -227,9 +233,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"15:11: Return from catch is not allowed.",
};
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromCatchCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromCatchCheck.java"), expected);
}
@Test
@@ -246,9 +250,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"15:11: Return from finally is not allowed.",
};
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromFinallyCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromFinallyCheck.java"), expected);
}
@Test
@@ -262,9 +264,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromFinallyCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromFinallyCheck.java"), expected);
}
@Test
@@ -284,9 +284,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"23:51: this cannot be null.",
};
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromFinallyCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromFinallyCheck.java"), expected);
}
@Test
@@ -305,9 +303,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"23:51: " + getCheckMessage(MSG_KEY_SUM_MAX, 2, 1, "NOT_EQUAL"),
};
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromFinallyCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromFinallyCheck.java"), expected);
}
@Test
@@ -328,9 +324,7 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"24:77: " + getCheckMessage(MSG_KEY_SUM_MIN, 1, 3, "EQUAL"),
};
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromFinallyCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromFinallyCheck.java"), expected);
}
@Test
@@ -352,8 +346,6 @@ public class DescendantTokenCheckTest extends BaseCheckTestSupport {
"24:77: custom message",
};
- verify(checkConfig,
- getPath("checks" + File.separator + "InputReturnFromFinallyCheck.java"),
- expected);
+ verify(checkConfig, getPath("InputReturnFromFinallyCheck.java"), expected);
}
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java
index 391a08afa..2666a8cb7 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertTrue;
import java.io.File;
+import java.io.IOException;
import java.util.List;
import java.util.Locale;
@@ -40,6 +41,11 @@ import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck;
public class FileSetCheckLifecycleTest
extends BaseCheckTestSupport {
@Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
+ @Override
protected DefaultConfiguration createCheckerConfig(
Configuration config) {
final DefaultConfiguration dc = new DefaultConfiguration("root");
@@ -58,7 +64,7 @@ public class FileSetCheckLifecycleTest
final Configuration checkConfig =
createCheckConfig(TestFileSetCheck.class);
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
assertTrue("destroy() not called by Checker", TestFileSetCheck.isDestroyed());
}
@@ -85,7 +91,7 @@ public class FileSetCheckLifecycleTest
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checker, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checker, getPath("InputIllegalTokens.java"), expected);
assertTrue("FileContent should be available during finishProcessing() call",
TestFileSetCheck.isFileContentAvailable());
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java
index 390185fc6..bad3af169 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java
@@ -21,12 +21,20 @@ package com.puppycrawl.tools.checkstyle.checks;
import static com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck.MSG_KEY;
+import java.io.File;
+import java.io.IOException;
+
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
public class FinalParametersCheckTest extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
@Test
public void testDefaultTokens() throws Exception {
final DefaultConfiguration checkConfig =
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java
index 914fffb0f..de7ad22da 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java
@@ -54,6 +54,11 @@ public class NewlineAtEndOfFileCheckTest
return dc;
}
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
@Test
public void testNewlineLfAtEndOfFile() throws Exception {
final DefaultConfiguration checkConfig =
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java
index abcf18347..a9a5fe49a 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java
@@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks;
import static org.junit.Assert.assertArrayEquals;
import java.io.File;
+import java.io.IOException;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Test;
@@ -31,6 +32,15 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
+ @Override
+ protected String getNonCompilablePath(String filename) throws IOException {
+ return super.getNonCompilablePath("checks" + File.separator + filename);
+ }
@Test
public void testGetRequiredTokens() {
@@ -49,7 +59,7 @@ public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
final DefaultConfiguration checkConfig =
createCheckConfig(OuterTypeFilenameCheck.class);
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, getPath("checks/InputIllegalTokens.java"), expected);
+ verify(checkConfig, getPath("InputIllegalTokens.java"), expected);
}
@Test
@@ -109,7 +119,6 @@ public class OuterTypeFilenameCheckTest extends BaseCheckTestSupport {
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, new File("src/test/resources-noncompilable/com/puppycrawl/tools/"
- + "checkstyle/checks/package-info.java").getCanonicalPath(), expected);
+ verify(checkConfig, getNonCompilablePath("package-info.java"), expected);
}
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java
index 963e18cba..ca642e6a0 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java
@@ -27,6 +27,7 @@ import static org.junit.Assert.fail;
import static org.powermock.api.mockito.PowerMockito.mock;
import java.io.File;
+import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -50,6 +51,15 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
@RunWith(PowerMockRunner.class)
@PrepareForTest({ SuppressWarningsHolder.class, SuppressWarningsHolderTest.class })
public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
+ @Override
+ protected String getNonCompilablePath(String filename) throws IOException {
+ return super.getNonCompilablePath("checks" + File.separator + filename);
+ }
@Test
public void testGetRequiredTokens() {
@@ -73,8 +83,7 @@ public class SuppressWarningsHolderTest extends BaseCheckTestSupport {
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
- verify(checkConfig, new File("src/test/resources-noncompilable/com/puppycrawl/tools/"
- + "checkstyle/InputSuppressWarningsHolder.java").getCanonicalPath(), expected);
+ verify(checkConfig, getNonCompilablePath("InputSuppressWarningsHolder.java"), expected);
}
@Test
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java
index 9ae07ef9d..63a23796c 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java
@@ -23,6 +23,9 @@ import static com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.MSG_KEY;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import java.io.File;
+import java.io.IOException;
+
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
@@ -31,6 +34,10 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class TodoCommentCheckTest
extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
@Test
public void testGetRequiredTokens() {
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
index cf09c05a8..48b25a6fe 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java
@@ -23,6 +23,9 @@ import static com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.MSG_KE
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import java.io.File;
+import java.io.IOException;
+
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Assert;
import org.junit.Before;
@@ -40,6 +43,11 @@ public class TrailingCommentCheckTest extends BaseCheckTestSupport {
checkConfig = createCheckConfig(TrailingCommentCheck.class);
}
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
@Test
public void testGetRequiredTokens() {
TrailingCommentCheck checkObj = new TrailingCommentCheck();
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java
index 12365497e..2f6a50ca6 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java
@@ -22,6 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks;
import static com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.MSG_KEY;
import static org.junit.Assert.assertEquals;
+import java.io.File;
+import java.io.IOException;
+
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Assert;
import org.junit.Test;
@@ -35,6 +38,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class UncommentedMainCheckTest
extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
@Test
public void testDefaults()
throws Exception {
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java
index 10cc58af1..d9fa88143 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
@@ -55,6 +56,11 @@ public class UniquePropertiesCheckTest extends BaseFileSetCheckTestSupport {
checkConfig = createCheckConfig(UniquePropertiesCheck.class);
}
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
+
/* Additional test for jacoco, since valueOf()
* is generated by javac and jacoco reports that
* valueOf() is uncovered.
@@ -78,8 +84,7 @@ public class UniquePropertiesCheckTest extends BaseFileSetCheckTestSupport {
"28: " + getCheckMessage(MSG_KEY, "Support Link ", 2),
"34: " + getCheckMessage(MSG_KEY, "failed", 2),
};
- verify(checkConfig, getPath("InputUniquePropertiesCheck.properties"),
- expected);
+ verify(checkConfig, getPath("InputUniquePropertiesCheck.properties"), expected);
}
/**
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java
index c1d083ff2..ef666e170 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java
@@ -23,6 +23,9 @@ import static com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.MSG_KEY;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import java.io.File;
+import java.io.IOException;
+
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
@@ -31,6 +34,10 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class UpperEllCheckTest
extends BaseCheckTestSupport {
+ @Override
+ protected String getPath(String filename) throws IOException {
+ return super.getPath("checks" + File.separator + filename);
+ }
@Test
public void testGetRequiredTokens() {
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java
index a1e28bbe5..9d3de1e43 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java
@@ -68,7 +68,7 @@ public class UnusedImportsCheckTest extends BaseCheckTestSupport {
"38:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.CheckerTest"),
"39:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.BaseFileSetCheckTestSupport"),
"40:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.Definitions"),
- "41:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.Input15Extensions"),
+ "41:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.checks.Input15Extensions"),
"42:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.ConfigurationLoaderTest"),
"43:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.PackageNamesLoader"),
"44:8: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.DefaultConfiguration"),