Skip to content

Commit

Permalink
Issue #11163: Enforce file size on InputJavadocStyle2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahulkhinchi03 authored and romani committed Mar 29, 2022
1 parent 214740c commit 96e1142
Show file tree
Hide file tree
Showing 7 changed files with 492 additions and 411 deletions.
2 changes: 0 additions & 2 deletions config/checkstyle_resources_suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@
files="[\\/]InputAstTreeStringPrinterTextBlocksEscapesAreOneChar\.java"/>

<!-- Until https://github.com/checkstyle/checkstyle/issues/11163 -->
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]javadocstyle[\\/]InputJavadocStyle2\.java"/>
<suppress checks="FileLength"
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]javadocstyle[\\/]InputJavadocStyle8\.java"/>
<suppress checks="FileLength"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,51 @@ public void testJavadocStyleDefaultSettingsFour()
}

@Test
public void testFirstSentence() throws Exception {
public void testJavadocStyleFirstSentenceOne() throws Exception {
final String[] expected = {
"23: " + getCheckMessage(MSG_NO_PERIOD),
"48: " + getCheckMessage(MSG_NO_PERIOD),
"65: " + getCheckMessage(MSG_NO_PERIOD),
"70: " + getCheckMessage(MSG_NO_PERIOD),
"75: " + getCheckMessage(MSG_NO_PERIOD),
"166: " + getCheckMessage(MSG_NO_PERIOD),
"199: " + getCheckMessage(MSG_NO_PERIOD),
"325: " + getCheckMessage(MSG_NO_PERIOD),
"335: " + getCheckMessage(MSG_NO_PERIOD),
"339: " + getCheckMessage(MSG_NO_PERIOD),
"346: " + getCheckMessage(MSG_NO_PERIOD),
"358: " + getCheckMessage(MSG_NO_PERIOD),
"371: " + getCheckMessage(MSG_NO_PERIOD),
};

verifyWithInlineConfigParser(
getPath("InputJavadocStyle2.java"), expected);
getPath("InputJavadocStyleFirstSentenceOne.java"), expected);
}

@Test
public void testJavadocStyleFirstSentenceTwo() throws Exception {
final String[] expected = {
"66: " + getCheckMessage(MSG_NO_PERIOD),
"99: " + getCheckMessage(MSG_NO_PERIOD),
};

verifyWithInlineConfigParser(
getPath("InputJavadocStyleFirstSentenceTwo.java"), expected);
}

@Test
public void testJavadocStyleFirstSentenceThree() throws Exception {
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;

verifyWithInlineConfigParser(
getPath("InputJavadocStyleFirstSentenceThree.java"), expected);
}

@Test
public void testJavadocStyleFirstSentenceFour() throws Exception {
final String[] expected = {
"40: " + getCheckMessage(MSG_NO_PERIOD),
"50: " + getCheckMessage(MSG_NO_PERIOD),
"54: " + getCheckMessage(MSG_NO_PERIOD),
"61: " + getCheckMessage(MSG_NO_PERIOD),
"73: " + getCheckMessage(MSG_NO_PERIOD),
"86: " + getCheckMessage(MSG_NO_PERIOD),
};

verifyWithInlineConfigParser(
getPath("InputJavadocStyleFirstSentenceFour.java"), expected);
}

@Test
Expand Down

0 comments on commit 96e1142

Please sign in to comment.