Skip to content

Commit

Permalink
Issue checkstyle#11446: last verify method is masked by suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
romani committed Sep 9, 2024
1 parent 3754ca1 commit eb168b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,8 @@
<!-- content of file does not matter at all -->
<exclude>**/RegexpOnFilenameCheckTest.class</exclude>

<!-- due to https://github.com/checkstyle/checkstyle/pull/13193 All the code needs to be in single line -->
<!-- due to https://github.com/checkstyle/checkstyle/pull/13193
All the code needs to be in single line -->
<exclude>**/OneStatementPerLineCheckTest.class</exclude>

<!-- this class contain forbidden verify method -->
Expand All @@ -1872,7 +1873,7 @@
<!-- content header is conflicting with Input inline header -->
<exclude>**/RegexpHeaderCheckTest.class</exclude>

<!-- all bellow until https://github.com/checkstyle/checkstyle/issues/11446 -->
<!-- until https://github.com/checkstyle/checkstyle/issues/15636 -->
<exclude>**/CheckerTest.class</exclude>
</excludes>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import com.puppycrawl.tools.checkstyle.internal.utils.CloseAndFlushTestByteArrayOutputStream;
import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil;
import com.puppycrawl.tools.checkstyle.utils.CommonUtil;
import de.thetaphi.forbiddenapis.SuppressForbidden;

/**
* CheckerTest.
Expand Down Expand Up @@ -1651,6 +1652,14 @@ public void testUnmappableCharacters() throws Exception {
expected);
}

/**
* This tests uses 'verify' method, because it needs some config
* to be executed on non-existing Input file,
* but BDD style methods need config in existing file.
*
* @throws Exception exception
*/
@SuppressForbidden
@Test
public void testViolationMessageOnIoException() throws Exception {
final DefaultConfiguration checkConfig =
Expand Down

0 comments on commit eb168b1

Please sign in to comment.