From a73e4ca77e8118c7c74b59ecbb25804355613c9f Mon Sep 17 00:00:00 2001 From: Suniti Date: Fri, 15 Dec 2023 19:31:26 +0530 Subject: [PATCH] Issue #11446: Update DetailAstImplTest to use execute --- pom.xml | 1 - .../com/puppycrawl/tools/checkstyle/DetailAstImplTest.java | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a6ed10c2b84..ee09c10338d 100644 --- a/pom.xml +++ b/pom.xml @@ -1830,7 +1830,6 @@ **/AbstractFileSetCheckTest.class - **/DetailAstImplTest.class **/TreeWalkerTest.class **/CheckerTest.class **/AllBlockCommentsTest.class diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java index e14015bff2e..4fc1599391f 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java @@ -41,7 +41,6 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; -import com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck; import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -686,6 +685,7 @@ public void testManyComments() throws Exception { final File file = new File(temporaryFolder, "InputDetailASTManyComments.java"); try (Writer bw = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { + bw.write("/*\ncom.puppycrawl.tools.checkstyle.checks.TodoCommentCheck\n\n\n\n*/\n"); bw.write("class C {\n"); for (int i = 0; i <= 30000; i++) { bw.write("// " + i + "\n"); @@ -693,10 +693,8 @@ public void testManyComments() throws Exception { bw.write("}\n"); } - final DefaultConfiguration checkConfig = createModuleConfig(TodoCommentCheck.class); - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verify(checkConfig, file.getAbsolutePath(), expected); + verifyWithInlineConfigParser(file.getAbsolutePath(), expected); } @Test