Skip to content

Commit a1338ac

Browse files
shashwatj07romani
authored andcommitted
Issue #10562: Update inputs for OuterTypeFilenameCheckTest
1 parent c350a32 commit a1338ac

14 files changed

+89
-74
lines changed

config/checkstyle_input_suppressions.xml

-52
Original file line numberDiff line numberDiff line change
@@ -620,32 +620,6 @@
620620
<suppress id="ConfigCommentOnTopInputs"
621621
files="nocodeinfile[\\/]InputNoCodeInFile5.java"/>
622622

623-
<suppress id="ConfigCommentOnTopInputs"
624-
files="outertypefilename[\\/]InputOuterTypeFilename15Extensions.java"/>
625-
626-
<suppress id="ConfigCommentOnTopInputs"
627-
files="outertypefilename[\\/]InputOuterTypeFilename1a.java"/>
628-
629-
<suppress id="ConfigCommentOnTopInputs"
630-
files="outertypefilename[\\/]InputOuterTypeFilename1.java"/>
631-
632-
<suppress id="ConfigCommentOnTopInputs"
633-
files="outertypefilename[\\/]InputOuterTypeFilename2.java"/>
634-
635-
<suppress id="ConfigCommentOnTopInputs"
636-
files="outertypefilename[\\/]InputOuterTypeFilename3.java"/>
637-
638-
<suppress id="ConfigCommentOnTopInputs"
639-
files="outertypefilename[\\/]InputOuterTypeFilename5.java"/>
640-
641-
<suppress id="ConfigCommentOnTopInputs"
642-
files="outertypefilename[\\/]InputOuterTypeFilenameCheckPublic.java"/>
643-
644-
<suppress id="ConfigCommentOnTopInputs"
645-
files="outertypefilename[\\/]InputOuterTypeFilenameIllegalTokens.java"/>
646-
647-
<suppress id="ConfigCommentOnTopInputs"
648-
files="outertypefilename[\\/]InputOuterTypeFilenameNoPublic.java"/>
649623

650624
<suppress id="ConfigCommentOnTopInputs"
651625
files="packagenamesloader[\\/]InputPackageNamesLoaderNotXml.java"/>
@@ -1296,32 +1270,6 @@
12961270
<suppress id="StyleValidationCommentInInputs"
12971271
files="nocodeinfile[\\/]InputNoCodeInFile5.java"/>
12981272

1299-
<suppress id="StyleValidationCommentInInputs"
1300-
files="outertypefilename[\\/]InputOuterTypeFilename15Extensions.java"/>
1301-
1302-
<suppress id="StyleValidationCommentInInputs"
1303-
files="outertypefilename[\\/]InputOuterTypeFilename1a.java"/>
1304-
1305-
<suppress id="StyleValidationCommentInInputs"
1306-
files="outertypefilename[\\/]InputOuterTypeFilename1.java"/>
1307-
1308-
<suppress id="StyleValidationCommentInInputs"
1309-
files="outertypefilename[\\/]InputOuterTypeFilename2.java"/>
1310-
1311-
<suppress id="StyleValidationCommentInInputs"
1312-
files="outertypefilename[\\/]InputOuterTypeFilename3.java"/>
1313-
1314-
<suppress id="StyleValidationCommentInInputs"
1315-
files="outertypefilename[\\/]InputOuterTypeFilename5.java"/>
1316-
1317-
<suppress id="StyleValidationCommentInInputs"
1318-
files="outertypefilename[\\/]InputOuterTypeFilenameCheckPublic.java"/>
1319-
1320-
<suppress id="StyleValidationCommentInInputs"
1321-
files="outertypefilename[\\/]InputOuterTypeFilenameIllegalTokens.java"/>
1322-
1323-
<suppress id="StyleValidationCommentInInputs"
1324-
files="outertypefilename[\\/]InputOuterTypeFilenameNoPublic.java"/>
13251273

13261274
<suppress id="StyleValidationCommentInInputs"
13271275
files="packagenamesloader[\\/]InputPackageNamesLoaderNotXml.java"/>

src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void testNestedClass() throws Exception {
9191
public void testNestedClass2() throws Exception {
9292
final DefaultConfiguration checkConfig = createModuleConfig(OuterTypeFilenameCheck.class);
9393
final String[] expected = {
94-
"3:1: " + getCheckMessage(MSG_KEY),
94+
"9:1: " + getCheckMessage(MSG_KEY),
9595
};
9696
verify(checkConfig, getPath("InputOuterTypeFilename1a.java"), expected);
9797
}
@@ -114,7 +114,7 @@ public void testPublicClassIsNotFirst() throws Exception {
114114
public void testNoPublicClasses() throws Exception {
115115
final DefaultConfiguration checkConfig = createModuleConfig(OuterTypeFilenameCheck.class);
116116
final String[] expected = {
117-
"3:1: " + getCheckMessage(MSG_KEY),
117+
"9:1: " + getCheckMessage(MSG_KEY),
118118
};
119119
verify(checkConfig, getPath("InputOuterTypeFilenameNoPublic.java"), expected);
120120
}
@@ -130,7 +130,7 @@ public void testFineDefault() throws Exception {
130130
public void testWrongDefault() throws Exception {
131131
final DefaultConfiguration checkConfig = createModuleConfig(OuterTypeFilenameCheck.class);
132132
final String[] expected = {
133-
"4:2: " + getCheckMessage(MSG_KEY),
133+
"10:2: " + getCheckMessage(MSG_KEY),
134134
};
135135
verify(checkConfig, getPath("InputOuterTypeFilename5.java"), expected);
136136
}
@@ -149,18 +149,19 @@ public void testOuterTypeFilenameRecords() throws Exception {
149149
final DefaultConfiguration checkConfig = createModuleConfig(OuterTypeFilenameCheck.class);
150150

151151
final String[] expected = {
152-
"7:1: " + getCheckMessage(MSG_KEY),
152+
"10:1: " + getCheckMessage(MSG_KEY),
153153
};
154154
verify(checkConfig,
155-
getNonCompilablePath("InputOuterTypeFilenameRecord.java"), expected);
155+
getNonCompilablePath("InputOuterTypeFilenameRecordMethodRecordDef.java"),
156+
expected);
156157
}
157158

158159
@Test
159160
public void testOuterTypeFilenameRecordsMethodRecordDef() throws Exception {
160161
final DefaultConfiguration checkConfig = createModuleConfig(OuterTypeFilenameCheck.class);
161162

162163
final String[] expected = {
163-
"7:1: " + getCheckMessage(MSG_KEY),
164+
"10:1: " + getCheckMessage(MSG_KEY),
164165
};
165166
verify(checkConfig,
166167
getNonCompilablePath("InputOuterTypeFilenameRecord.java"), expected);
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
//non-compiled with javac: contains different class name by demand of test
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
/* Config:
5-
* default
6-
*/
710
public record IncorrectName1(int x, int y, String str) { // violation
811
}

src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/outertypefilename/InputOuterTypeFilenameRecordMethodRecordDef.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
//non-compiled with javac: contains different class name by demand of test
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
/* Config:
5-
* default
6-
*/
710
public record IncorrectName2(int x, int y, String str) { // violation
811
class LocalRecordHelper {
912
Record recordMethod(int x) {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
@Deprecated
2-
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
8+
package com.puppycrawl.tools.checkstyle.checks.outertypefilename; // ok
39

src/test/resources/com/puppycrawl/tools/checkstyle/checks/outertypefilename/InputOuterTypeFilename1.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
// someexamples of 1.5 extensions
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
public class InputOuterTypeFilename1 {
10+
public class InputOuterTypeFilename1 { // ok
511

612
public class UnicClassName {
713

src/test/resources/com/puppycrawl/tools/checkstyle/checks/outertypefilename/InputOuterTypeFilename15Extensions.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
// someexamples of 1.5 extensions
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
@interface MyAnnotation1 {
10+
@interface MyAnnotation1 { // ok
511
String name();
612
int version();
713
}

src/test/resources/com/puppycrawl/tools/checkstyle/checks/outertypefilename/InputOuterTypeFilename1a.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
28

3-
class Class1 {
9+
class Class1 { // violation
410
public interface NestedInterface {}
511
public enum NestedEnum {}
612
class NestedClass {}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
// someexamples of 1.5 extensions
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
public class InputOuterTypeFilename2 {
10+
public class InputOuterTypeFilename2 { // ok
511

612

713
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
// someexamples of 1.5 extensions
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
class InputOuterTypeFilename3 {
10+
class InputOuterTypeFilename3 { // ok
511

612

713
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
// someexamples of 1.5 extensions
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
class InputOuterTypeFilename5NameMismatch {
10+
class InputOuterTypeFilename5NameMismatch { // violation
511

612

713
}

src/test/resources/com/puppycrawl/tools/checkstyle/checks/outertypefilename/InputOuterTypeFilenameCheckPublic.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
// someexamples of 1.5 extensions
28
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
39

4-
class UnicClassName {
10+
class UnicClassName { // ok
511

612
}
713

src/test/resources/com/puppycrawl/tools/checkstyle/checks/outertypefilename/InputOuterTypeFilenameIllegalTokens.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
28

3-
public class InputOuterTypeFilenameIllegalTokens
9+
public class InputOuterTypeFilenameIllegalTokens // ok
410
{
511
public void methodWithPreviouslyIllegalTokens()
612
{
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
/*
2+
OuterTypeFilename
3+
4+
5+
*/
6+
17
package com.puppycrawl.tools.checkstyle.checks.outertypefilename;
28

3-
class Foo {}
9+
class Foo {} // violation
410
enum FooEnum {}

0 commit comments

Comments
 (0)