Skip to content

Commit

Permalink
Issue checkstyle#14436: Enforced naming convention for illegaltoken
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and romani committed Feb 17, 2024
1 parent b08ea45 commit a4411aa
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,42 @@ protected String getPackageLocation() {
}

@Test
public void testCheckWithDefaultSettings()
public void testIllegalTokensCheckDefaultTokenLabel()
throws Exception {
final String[] expected = {
"36:14: " + getCheckMessage(MSG_KEY, "label:"),
"38:25: " + getCheckMessage(MSG_KEY, "anotherLabel:"),
};
verifyWithInlineConfigParser(
getPath("InputIllegalTokens.java"), expected);
getPath("InputIllegalTokensCheckDefaultTokenLabel.java"), expected);
}

@Test
public void testPreviouslyIllegalTokens()
public void testIllegalTokensCheckSwitchAndPostIncDec()
throws Exception {
final String[] expected = {
"18:9: " + getCheckMessage(MSG_KEY, "switch"),
"21:18: " + getCheckMessage(MSG_KEY, "--"),
"22:18: " + getCheckMessage(MSG_KEY, "++"),
};
verifyWithInlineConfigParser(
getPath("InputIllegalTokens2.java"), expected);
getPath("InputIllegalTokensCheckSwitchAndPostIncDec.java"), expected);
}

@Test
public void testNative() throws Exception {
public void testIllegalTokensCheckTokenNative() throws Exception {
final String[] expected = {
"27:12: " + getCheckMessage(MSG_KEY, "native"),
};
verifyWithInlineConfigParser(
getPath("InputIllegalTokens3.java"), expected);
getPath("InputIllegalTokensCheckTokenNative.java"), expected);
}

@Test
public void testCommentContentToken()
public void testIllegalTokensCheckCommentsContent()
throws Exception {

final String path = getPath("InputIllegalTokens4.java");
final String path = getPath("InputIllegalTokensCheckCommentsContent.java");
final String lineSeparator =
CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8);
final String[] expected = {
Expand All @@ -100,39 +100,39 @@ public void testCommentContentToken()
}

@Test
public void testBlockCommentBeginToken()
public void testIllegalTokensCheckBlockCommentBegin()
throws Exception {

final String[] expected = {
"1:1: " + getCheckMessage(MSG_KEY, "/*"),
"10:1: " + getCheckMessage(MSG_KEY, "/*"),
};
verifyWithInlineConfigParser(
getPath("InputIllegalTokens5.java"), expected);
getPath("InputIllegalTokensCheckBlockCommentBegin.java"), expected);
}

@Test
public void testBlockCommentEndToken()
public void testIllegalTokensCheckBlockCommentEnd()
throws Exception {

final String[] expected = {
"6:1: " + getCheckMessage(MSG_KEY, "*/"),
"12:2: " + getCheckMessage(MSG_KEY, "*/"),
};
verifyWithInlineConfigParser(
getPath("InputIllegalTokens6.java"), expected);
getPath("InputIllegalTokensCheckBlockCommentEnd.java"), expected);
}

@Test
public void testSingleLineCommentToken()
public void testIllegalTokensCheckSingleLineComment()
throws Exception {

final String[] expected = {
"38:27: " + getCheckMessage(MSG_KEY, "//"),
"42:26: " + getCheckMessage(MSG_KEY, "//"),
};
verifyWithInlineConfigParser(
getPath("InputIllegalTokens7.java"), expected);
getPath("InputIllegalTokensCheckSingleLineComment.java"), expected);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/** // violation
* Test for illegal tokens
*/
public class InputIllegalTokens5
public class InputIllegalTokensCheckBlockCommentBegin
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Test for illegal tokens
*/ // violation
public class InputIllegalTokens6
public class InputIllegalTokensCheckBlockCommentEnd
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/** // violation
* Test for illegal tokens
*/
public class InputIllegalTokens4
public class InputIllegalTokensCheckCommentsContent
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Test for illegal tokens
*/
public class InputIllegalTokens
public class InputIllegalTokensCheckDefaultTokenLabel
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Test for illegal tokens
*/
public class InputIllegalTokens7
public class InputIllegalTokensCheckSingleLineComment
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Test for illegal tokens
*/
public class InputIllegalTokens2
public class InputIllegalTokensCheckSwitchAndPostIncDec
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Test for illegal tokens
*/
public class InputIllegalTokens3
public class InputIllegalTokensCheckTokenNative
{
public void methodWithPreviouslyIllegalTokens()
{
Expand Down

0 comments on commit a4411aa

Please sign in to comment.