diff --git a/config/checkstyle_checks.xml b/config/checkstyle_checks.xml
index 9cb39c4ff..12c15b0fa 100644
--- a/config/checkstyle_checks.xml
+++ b/config/checkstyle_checks.xml
@@ -299,9 +299,10 @@
-
+
+
@@ -314,7 +315,6 @@
-
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java
index c43b976ec..6564dad14 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java
@@ -237,13 +237,6 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
verify(checkConfig, pathToEmptyFile, expected);
}
- public static class BadJavaDocCheck extends Check {
- @Override
- public int[] getDefaultTokens() {
- return new int[]{TokenTypes.SINGLE_LINE_COMMENT};
- }
- }
-
@Test
public void testProcessNonJavaFiles() throws Exception {
final TreeWalker treeWalker = new TreeWalker();
@@ -300,4 +293,11 @@ public class TreeWalkerTest extends BaseCheckTestSupport {
treeWalker.processFiltered(file, lines);
}
+
+ public static class BadJavaDocCheck extends Check {
+ @Override
+ public int[] getDefaultTokens() {
+ return new int[]{TokenTypes.SINGLE_LINE_COMMENT};
+ }
+ }
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/AutomaticBeanTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/AutomaticBeanTest.java
index 0a02db45d..c04062fac 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AutomaticBeanTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AutomaticBeanTest.java
@@ -33,39 +33,6 @@ import com.puppycrawl.tools.checkstyle.DefaultContext;
public class AutomaticBeanTest {
- public class TestBean extends AutomaticBean {
-
- private String privateField;
-
- private String wrong;
-
- private int val;
-
- public void setWrong(String wrong) {
- this.wrong = wrong;
- }
-
- public void setVal(int val) {
- this.val = val;
- }
-
- public void setExceptionalMethod(String value) {
- throw new IllegalStateException("for UT");
- }
-
- public void setName(String name) {
- }
-
- /**
- * just for code coverage
- * @param childConf a child of this component's Configuration
- */
- @Override
- protected void setupChild(Configuration childConf) throws CheckstyleException {
- super.setupChild(childConf);
- }
- }
-
@Test
public void testConfigure_NoSuchAttribute() {
final TestBean testBean = new TestBean();
@@ -130,4 +97,36 @@ public class AutomaticBeanTest {
}
}
+ public class TestBean extends AutomaticBean {
+
+ private String privateField;
+
+ private String wrong;
+
+ private int val;
+
+ public void setWrong(String wrong) {
+ this.wrong = wrong;
+ }
+
+ public void setVal(int val) {
+ this.val = val;
+ }
+
+ public void setExceptionalMethod(String value) {
+ throw new IllegalStateException("for UT");
+ }
+
+ public void setName(String name) {
+ }
+
+ /**
+ * just for code coverage
+ * @param childConf a child of this component's Configuration
+ */
+ @Override
+ protected void setupChild(Configuration childConf) throws CheckstyleException {
+ super.setupChild(childConf);
+ }
+ }
}
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 168528b78..2ac7f5316 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FileSetCheckLifecycleTest.java
@@ -45,33 +45,6 @@ public class FileSetCheckLifecycleTest
return dc;
}
- public static class TestFileSetCheck extends AbstractFileSetCheck {
- private static boolean destroyed;
- private static boolean fileContentAvailable;
-
- @Override
- public void destroy() {
- destroyed = true;
- }
-
- public static boolean isDestroyed() {
- return destroyed;
- }
-
- public static boolean isFileContentAvailable() {
- return fileContentAvailable;
- }
-
- @Override
- protected void processFiltered(File file, List lines) {
- }
-
- @Override
- public void finishProcessing() {
- fileContentAvailable = FileContentsHolder.getContents() != null;
- }
- }
-
@Test
public void testTranslation() throws Exception {
final Configuration checkConfig =
@@ -111,4 +84,31 @@ public class FileSetCheckLifecycleTest
assertTrue("FileContent should be available during finishProcessing() call",
TestFileSetCheck.isFileContentAvailable());
}
+
+ public static class TestFileSetCheck extends AbstractFileSetCheck {
+ private static boolean destroyed;
+ private static boolean fileContentAvailable;
+
+ @Override
+ public void destroy() {
+ destroyed = true;
+ }
+
+ public static boolean isDestroyed() {
+ return destroyed;
+ }
+
+ public static boolean isFileContentAvailable() {
+ return fileContentAvailable;
+ }
+
+ @Override
+ protected void processFiltered(File file, List lines) {
+ }
+
+ @Override
+ public void finishProcessing() {
+ fileContentAvailable = FileContentsHolder.getContents() != null;
+ }
+ }
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java
index a02d6a359..5be3c7f11 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java
@@ -33,19 +33,6 @@ import com.puppycrawl.tools.checkstyle.TreeWalker;
import com.puppycrawl.tools.checkstyle.api.DetailNode;
public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
- public static class TempCheck extends AbstractJavadocCheck {
-
- @Override
- public int[] getDefaultJavadocTokens() {
- return null;
- }
-
- @Override
- public void visitJavadocToken(DetailNode ast) {
- // do nothing
- }
-
- }
@Test
public void testNumberFormatException() throws Exception {
@@ -92,4 +79,17 @@ public class AbstractJavadocCheckTest extends BaseCheckTestSupport {
};
verify(checker, getPath("javadoc/InputCorrectJavaDocParagraphCheck.java"), expected);
}
+
+ public static class TempCheck extends AbstractJavadocCheck {
+
+ @Override
+ public int[] getDefaultJavadocTokens() {
+ return null;
+ }
+
+ @Override
+ public void visitJavadocToken(DetailNode ast) {
+ // do nothing
+ }
+ }
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllBlockCommentsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllBlockCommentsTest.java
index 59149dd85..cea443a9d 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllBlockCommentsTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllBlockCommentsTest.java
@@ -38,6 +38,15 @@ public class AllBlockCommentsTest extends BaseCheckTestSupport {
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+ @Test
+ public void testAllBlockComments() throws Exception {
+ DefaultConfiguration checkConfig = createCheckConfig(BlockCommentListenerCheck.class);
+ final String[] expected = {};
+ verify(checkConfig, getPath("comments" + File.separator
+ + "InputFullOfBlockComments.java"), expected);
+ Assert.assertTrue(allComments.isEmpty());
+ }
+
public static class BlockCommentListenerCheck extends Check {
@Override
public boolean isCommentNodesRequired() {
@@ -74,15 +83,5 @@ public class AllBlockCommentsTest extends BaseCheckTestSupport {
Assert.fail("Unexpected comment: " + commentContent);
}
}
-
- }
-
- @Test
- public void testAllBlockComments() throws Exception {
- DefaultConfiguration checkConfig = createCheckConfig(BlockCommentListenerCheck.class);
- final String[] expected = {};
- verify(checkConfig, getPath("comments" + File.separator
- + "InputFullOfBlockComments.java"), expected);
- Assert.assertTrue(allComments.isEmpty());
}
}
diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllSinglelineCommentsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllSinglelineCommentsTest.java
index becdd1230..e9b6023a7 100644
--- a/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllSinglelineCommentsTest.java
+++ b/src/test/java/com/puppycrawl/tools/checkstyle/comments/AllSinglelineCommentsTest.java
@@ -37,6 +37,15 @@ public class AllSinglelineCommentsTest extends BaseCheckTestSupport {
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+ @Test
+ public void testAllBlockComments() throws Exception {
+ DefaultConfiguration checkConfig = createCheckConfig(SinglelineCommentListenerCheck.class);
+ final String[] expected = {};
+ verify(checkConfig, getPath("comments" + File.separator
+ + "InputFullOfSinglelineComments.java"), expected);
+ Assert.assertTrue(allComments.isEmpty());
+ }
+
public static class SinglelineCommentListenerCheck extends Check {
@Override
public boolean isCommentNodesRequired() {
@@ -69,15 +78,5 @@ public class AllSinglelineCommentsTest extends BaseCheckTestSupport {
Assert.fail("Unexpected comment: " + commentContent);
}
}
-
- }
-
- @Test
- public void testAllBlockComments() throws Exception {
- DefaultConfiguration checkConfig = createCheckConfig(SinglelineCommentListenerCheck.class);
- final String[] expected = {};
- verify(checkConfig, getPath("comments" + File.separator
- + "InputFullOfSinglelineComments.java"), expected);
- Assert.assertTrue(allComments.isEmpty());
}
}