Skip to content

Commit

Permalink
Issue checkstyle#11163: Enforced File size AbstractJavadocPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and romani committed Jan 16, 2024
1 parent 2f49e8d commit b47c25f
Show file tree
Hide file tree
Showing 7 changed files with 339 additions and 293 deletions.
2 changes: 0 additions & 2 deletions config/checkstyle-input-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1666,8 +1666,6 @@
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocNonTightHtmlTagsNoViolation.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocNonTightHtmlTagsNoViolation.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPosition.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPositionOnlyComments.java"/>
<suppress id="UnnecessaryOkComment"
Expand Down
2 changes: 0 additions & 2 deletions config/checkstyle-resources-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@
files="[\\/]InputJavaNCSSRecordsMax\.java"/>

<!-- Until https://github.com/checkstyle/checkstyle/issues/11163 -->
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocPosition\.java"/>
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]abstractjavadoc[\\/]InputAbstractJavadocNonTightHtmlTagsNoViolation\.java"/>
<suppress checks="FileLength"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,39 @@ public void testCache() throws Exception {
}

@Test
public void testPosition() throws Exception {
public void testPositionOne() throws Exception {
JavadocCatchCheck.clearCounter();
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(getPath("InputAbstractJavadocPosition.java"), expected);
verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionOne.java"), expected);
assertWithMessage("Invalid number of javadocs")
.that(JavadocCatchCheck.javadocsNumber)
// until https://github.com/checkstyle/checkstyle/issues/12586
// actual javadoc count is 65, but verifyWithInlineConfigParser verify file twice
.isEqualTo(130);
// actual javadoc count is 21, but verifyWithInlineConfigParser verify file twice
.isEqualTo(42);
}

@Test
public void testPositionTwo() throws Exception {
JavadocCatchCheck.clearCounter();
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionTwo.java"), expected);
assertWithMessage("Invalid number of javadocs")
.that(JavadocCatchCheck.javadocsNumber)
// until https://github.com/checkstyle/checkstyle/issues/12586
// actual javadoc count is 29, but verifyWithInlineConfigParser verify file twice
.isEqualTo(58);
}

@Test
public void testPositionThree() throws Exception {
JavadocCatchCheck.clearCounter();
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionThree.java"), expected);
assertWithMessage("Invalid number of javadocs")
.that(JavadocCatchCheck.javadocsNumber)
// until https://github.com/checkstyle/checkstyle/issues/12586
// actual javadoc count is 15, but verifyWithInlineConfigParser verify file twice
.isEqualTo(30);
}

@Test
Expand Down

This file was deleted.

Loading

0 comments on commit b47c25f

Please sign in to comment.