Skip to content

Commit 101e623

Browse files
MANISH-K-07rnveach
authored andcommitted
Issue #14715: Enforced new naming convention in IT area 24
1 parent 145f1e1 commit 101e623

25 files changed

+64
-71
lines changed

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected String getCheckName() {
4141
@Test
4242
public void testOne() throws Exception {
4343
final File fileToProcess = new File(getNonCompilablePath(
44-
"SuppressionXpathRegressionIllegalIdentifierNameTestOne.java"));
44+
"InputXpathIllegalIdentifierNameOne.java"));
4545

4646
final DefaultConfiguration moduleConfig =
4747
createModuleConfig(IllegalIdentifierNameCheck.class);
@@ -55,7 +55,7 @@ public void testOne() throws Exception {
5555

5656
final List<String> expectedXpathQueries = Collections.singletonList(
5757
"/COMPILATION_UNIT/RECORD_DEF"
58-
+ "[./IDENT[@text='SuppressionXpathRegressionIllegalIdentifierNameTestOne'"
58+
+ "[./IDENT[@text='InputXpathIllegalIdentifierNameOne'"
5959
+ "]]/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='yield']"
6060
);
6161

@@ -66,7 +66,7 @@ public void testOne() throws Exception {
6666
@Test
6767
public void testTwo() throws Exception {
6868
final File fileToProcess = new File(getNonCompilablePath(
69-
"SuppressionXpathRegressionIllegalIdentifierNameTestTwo.java"));
69+
"InputXpathIllegalIdentifierNameTwo.java"));
7070

7171
final DefaultConfiguration moduleConfig =
7272
createModuleConfig(IllegalIdentifierNameCheck.class);
@@ -80,7 +80,7 @@ public void testTwo() throws Exception {
8080

8181
final List<String> expectedXpathQueries = Collections.singletonList(
8282
"/COMPILATION_UNIT/CLASS_DEF"
83-
+ "[./IDENT[@text='SuppressionXpathRegressionIllegalIdentifierNameTestTwo']"
83+
+ "[./IDENT[@text='InputXpathIllegalIdentifierNameTwo']"
8484
+ "]/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/PARAMETERS/PARAMETER_DEF"
8585
+ "/IDENT[@text='yield']"
8686
);

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalInstantiationTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected String getCheckName() {
3838

3939
@Test
4040
public void testSimple() throws Exception {
41-
final String fileName = "SuppressionXpathRegressionIllegalInstantiationSimple.java";
41+
final String fileName = "InputXpathIllegalInstantiationSimple.java";
4242
final File fileToProcess = new File(getNonCompilablePath(fileName));
4343

4444
final DefaultConfiguration moduleConfig =
@@ -52,11 +52,11 @@ public void testSimple() throws Exception {
5252

5353
final List<String> expectedXpathQueries = Arrays.asList(
5454
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
55-
+ "[@text='SuppressionXpathRegressionIllegalInstantiationSimple']]"
55+
+ "[@text='InputXpathIllegalInstantiationSimple']]"
5656
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/"
5757
+ "VARIABLE_DEF[./IDENT[@text='x']]/ASSIGN/EXPR",
5858
"/COMPILATION_UNIT/CLASS_DEF"
59-
+ "[./IDENT[@text='SuppressionXpathRegressionIllegalInstantiationSimple']]"
59+
+ "[./IDENT[@text='InputXpathIllegalInstantiationSimple']]"
6060
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF"
6161
+ "[./IDENT[@text='x']]/ASSIGN/EXPR/LITERAL_NEW[./IDENT[@text='Boolean']]"
6262
);
@@ -67,7 +67,7 @@ public void testSimple() throws Exception {
6767

6868
@Test
6969
public void testAnonymous() throws Exception {
70-
final String fileName = "SuppressionXpathRegressionIllegalInstantiationAnonymous.java";
70+
final String fileName = "InputXpathIllegalInstantiationAnonymous.java";
7171
final File fileToProcess = new File(getNonCompilablePath(fileName));
7272

7373
final DefaultConfiguration moduleConfig =
@@ -81,11 +81,11 @@ public void testAnonymous() throws Exception {
8181

8282
final List<String> expectedXpathQueries = Arrays.asList(
8383
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
84-
+ "[@text='SuppressionXpathRegressionIllegalInstantiationAnonymous']]"
84+
+ "[@text='InputXpathIllegalInstantiationAnonymous']]"
8585
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Inner']]/OBJBLOCK/METHOD_DEF"
8686
+ "[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[./IDENT[@text='e']]/ASSIGN/EXPR",
8787
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
88-
+ "[@text='SuppressionXpathRegressionIllegalInstantiationAnonymous']]"
88+
+ "[@text='InputXpathIllegalInstantiationAnonymous']]"
8989
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Inner']]/OBJBLOCK/METHOD_DEF"
9090
+ "[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[./IDENT[@text='e']]"
9191
+ "/ASSIGN/EXPR/LITERAL_NEW[./IDENT[@text='Integer']]"
@@ -97,7 +97,7 @@ public void testAnonymous() throws Exception {
9797

9898
@Test
9999
public void testInterface() throws Exception {
100-
final String fileName = "SuppressionXpathRegressionIllegalInstantiationInterface.java";
100+
final String fileName = "InputXpathIllegalInstantiationInterface.java";
101101
final File fileToProcess = new File(getNonCompilablePath(fileName));
102102

103103
final DefaultConfiguration moduleConfig =
@@ -111,12 +111,12 @@ public void testInterface() throws Exception {
111111

112112
final List<String> expectedXpathQueries = Arrays.asList(
113113
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
114-
+ "[@text='SuppressionXpathRegressionIllegalInstantiationInterface']]"
114+
+ "[@text='InputXpathIllegalInstantiationInterface']]"
115115
+ "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Inner']]/"
116116
+ "OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/"
117117
+ "VARIABLE_DEF[./IDENT[@text='s']]/ASSIGN/EXPR",
118118
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
119-
+ "[@text='SuppressionXpathRegressionIllegalInstantiationInterface']]"
119+
+ "[@text='InputXpathIllegalInstantiationInterface']]"
120120
+ "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Inner']]"
121121
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF"
122122
+ "[./IDENT[@text='s']]/ASSIGN/EXPR/LITERAL_NEW[./IDENT[@text='String']]"

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected String getCheckName() {
4141
public void testOne() throws Exception {
4242
final File fileToProcess =
4343
new File(getNonCompilablePath(
44-
"SuppressionXpathRegressionPackageAnnotationOne.java"));
44+
"InputXpathPackageAnnotationOne.java"));
4545

4646
final DefaultConfiguration moduleConfig =
4747
createModuleConfig(PackageAnnotationCheck.class);
@@ -62,7 +62,7 @@ public void testOne() throws Exception {
6262
public void testTwo() throws Exception {
6363
final File fileToProcess =
6464
new File(getNonCompilablePath(
65-
"SuppressionXpathRegressionPackageAnnotationTwo.java"));
65+
"InputXpathPackageAnnotationTwo.java"));
6666

6767
final DefaultConfiguration moduleConfig =
6868
createModuleConfig(PackageAnnotationCheck.class);

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ protected String getCheckName() {
3838
}
3939

4040
@Test
41-
public void test1() throws Exception {
41+
public void testWrongPackage() throws Exception {
4242
final File fileToProcess =
43-
new File(getNonCompilablePath("SuppressionXpathRegression1.java"));
43+
new File(getNonCompilablePath("InputXpathWrongPackage.java"));
4444

4545
final DefaultConfiguration moduleConfig =
4646
createModuleConfig(PackageDeclarationCheck.class);
@@ -59,9 +59,9 @@ public void test1() throws Exception {
5959
}
6060

6161
@Test
62-
public void test2() throws Exception {
62+
public void testMissingPackage() throws Exception {
6363
final File fileToProcess =
64-
new File(getNonCompilablePath("SuppressionXpathRegression2.java"));
64+
new File(getNonCompilablePath("InputXpathMissingPackage.java"));
6565

6666
final DefaultConfiguration moduleConfig =
6767
createModuleConfig(PackageDeclarationCheck.class);
@@ -73,11 +73,11 @@ public void test2() throws Exception {
7373

7474
final List<String> expectedXpathQueries = Arrays.asList(
7575
"/COMPILATION_UNIT",
76-
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRegression2']]",
76+
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathMissingPackage']]",
7777
"/COMPILATION_UNIT/CLASS_DEF"
78-
+ "[./IDENT[@text='SuppressionXpathRegression2']]/MODIFIERS",
78+
+ "[./IDENT[@text='InputXpathMissingPackage']]/MODIFIERS",
7979
"/COMPILATION_UNIT/CLASS_DEF"
80-
+ "[./IDENT[@text='SuppressionXpathRegression2']]/MODIFIERS/LITERAL_PUBLIC"
80+
+ "[./IDENT[@text='InputXpathMissingPackage']]/MODIFIERS/LITERAL_PUBLIC"
8181
);
8282

8383
runVerifications(moduleConfig, fileToProcess, expectedViolation,

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected String getCheckName() {
4242
public void testOne() throws Exception {
4343
final File fileToProcess =
4444
new File(getNonCompilablePath(
45-
"SuppressionXpathRegressionPatternVariableName1.java"));
45+
"InputXpathPatternVariableNameOne.java"));
4646

4747
final DefaultConfiguration moduleConfig =
4848
createModuleConfig(PatternVariableNameCheck.class);
@@ -56,7 +56,7 @@ public void testOne() throws Exception {
5656

5757
final List<String> expectedXpathQueries = Collections.singletonList(
5858
"/COMPILATION_UNIT/CLASS_DEF"
59-
+ "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName1']]"
59+
+ "[./IDENT[@text='InputXpathPatternVariableNameOne']]"
6060
+ "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/"
6161
+ "LITERAL_INSTANCEOF[./IDENT[@text='o1']]/PATTERN_VARIABLE_DEF/"
6262
+ "IDENT[@text='STRING1']"
@@ -70,7 +70,7 @@ public void testOne() throws Exception {
7070
public void testTwo() throws Exception {
7171
final File fileToProcess =
7272
new File(getNonCompilablePath(
73-
"SuppressionXpathRegressionPatternVariableName2.java"));
73+
"InputXpathPatternVariableNameTwo.java"));
7474

7575
final String nonDefaultPattern = "^_[a-zA-Z0-9]*$";
7676

@@ -85,7 +85,7 @@ public void testTwo() throws Exception {
8585

8686
final List<String> expectedXpathQueries = Collections.singletonList(
8787
"/COMPILATION_UNIT/CLASS_DEF"
88-
+ "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName2']]"
88+
+ "[./IDENT[@text='InputXpathPatternVariableNameTwo']]"
8989
+ "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/"
9090
+ "LITERAL_INSTANCEOF[./IDENT[@text='o1']]/"
9191
+ "PATTERN_VARIABLE_DEF/IDENT[@text='s']"
@@ -99,7 +99,7 @@ public void testTwo() throws Exception {
9999
public void testThree() throws Exception {
100100
final File fileToProcess =
101101
new File(getNonCompilablePath(
102-
"SuppressionXpathRegressionPatternVariableName3.java"));
102+
"InputXpathPatternVariableNameThree.java"));
103103

104104
final String nonDefaultPattern = "^[a-z](_?[a-zA-Z0-9]+)*$";
105105

@@ -114,7 +114,7 @@ public void testThree() throws Exception {
114114

115115
final List<String> expectedXpathQueries = Collections.singletonList(
116116
"/COMPILATION_UNIT/CLASS_DEF"
117-
+ "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName3']]"
117+
+ "[./IDENT[@text='InputXpathPatternVariableNameThree']]"
118118
+ "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/"
119119
+ "EXPR/LITERAL_INSTANCEOF[./IDENT[@text='o1']]/"
120120
+ "PATTERN_VARIABLE_DEF/IDENT[@text='STR']"
@@ -128,7 +128,7 @@ public void testThree() throws Exception {
128128
public void testFour() throws Exception {
129129
final File fileToProcess =
130130
new File(getNonCompilablePath(
131-
"SuppressionXpathRegressionPatternVariableName4.java"));
131+
"InputXpathPatternVariableNameFour.java"));
132132

133133
final String nonDefaultPattern = "^[a-z][_a-zA-Z0-9]{2,}$";
134134

@@ -143,7 +143,7 @@ public void testFour() throws Exception {
143143

144144
final List<String> expectedXpathQueries = Collections.singletonList(
145145
"/COMPILATION_UNIT/CLASS_DEF"
146-
+ "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName1']]"
146+
+ "[./IDENT[@text='InputXpathPatternVariableNameFour']]"
147147
+ "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/"
148148
+ "LITERAL_INSTANCEOF[./IDENT[@text='o1']]/"
149149
+ "PATTERN_VARIABLE_DEF/IDENT[@text='st']"

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ protected String getCheckName() {
3939
}
4040

4141
@Test
42-
public void testOne() throws Exception {
42+
public void testDefault() throws Exception {
4343
final File fileToProcess = new File(getNonCompilablePath(
44-
"SuppressionXpathRecordComponentName1.java"));
44+
"InputXpathRecordComponentNameDefault.java"));
4545

4646
final DefaultConfiguration moduleConfig =
4747
createModuleConfig(RecordComponentNameCheck.class);
@@ -53,7 +53,7 @@ public void testOne() throws Exception {
5353
};
5454

5555
final List<String> expectedXpathQueries = Collections.singletonList(
56-
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentName1']]"
56+
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='InputXpathRecordComponentNameDefault']]"
5757
+ "/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='_value']"
5858
);
5959

@@ -62,9 +62,9 @@ public void testOne() throws Exception {
6262
}
6363

6464
@Test
65-
public void testTwo() throws Exception {
65+
public void testFormat() throws Exception {
6666
final File fileToProcess = new File(getNonCompilablePath(
67-
"SuppressionXpathRecordComponentName2.java"));
67+
"InputXpathRecordComponentNameFormat.java"));
6868

6969
final DefaultConfiguration moduleConfig =
7070
createModuleConfig(RecordComponentNameCheck.class);
@@ -78,7 +78,7 @@ public void testTwo() throws Exception {
7878

7979
final List<String> expectedXpathQueries = Collections.singletonList(
8080
"/COMPILATION_UNIT/CLASS_DEF"
81-
+ "[./IDENT[@text='SuppressionXpathRecordComponentName2']]/OBJBLOCK"
81+
+ "[./IDENT[@text='InputXpathRecordComponentNameFormat']]/OBJBLOCK"
8282
+ "/RECORD_DEF[./IDENT[@text='MyRecord']]"
8383
+ "/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='otherValue']"
8484
);

src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ protected String getCheckName() {
3838
}
3939

4040
@Test
41-
public void testOne() throws Exception {
41+
public void testDefault() throws Exception {
4242
final File fileToProcess = new File(getNonCompilablePath(
43-
"SuppressionXpathRecordComponentNumber1.java"));
43+
"InputXpathRecordComponentNumberDefault.java"));
4444

4545
final DefaultConfiguration moduleConfig =
4646
createModuleConfig(RecordComponentNumberCheck.class);
@@ -52,10 +52,10 @@ public void testOne() throws Exception {
5252
};
5353

5454
final List<String> expectedXpathQueries = Arrays.asList(
55-
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentNumber1']]",
56-
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentNumber1']]"
55+
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='InputXpathRecordComponentNumberDefault']]",
56+
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='InputXpathRecordComponentNumberDefault']]"
5757
+ "/MODIFIERS",
58-
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentNumber1']]"
58+
"/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='InputXpathRecordComponentNumberDefault']]"
5959
+ "/MODIFIERS/LITERAL_PUBLIC"
6060
);
6161

@@ -64,9 +64,9 @@ public void testOne() throws Exception {
6464
}
6565

6666
@Test
67-
public void testTwo() throws Exception {
67+
public void testCustomMax() throws Exception {
6868
final File fileToProcess = new File(getNonCompilablePath(
69-
"SuppressionXpathRecordComponentNumber2.java"));
69+
"InputXpathRecordComponentNumberCustomMax.java"));
7070

7171
final DefaultConfiguration moduleConfig =
7272
createModuleConfig(RecordComponentNumberCheck.class);
@@ -79,11 +79,11 @@ public void testTwo() throws Exception {
7979
};
8080

8181
final List<String> expectedXpathQueries = Arrays.asList(
82-
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRecordComponentNumber2']]"
82+
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathRecordComponentNumberCustomMax']]"
8383
+ "/OBJBLOCK/RECORD_DEF[./IDENT[@text='MyRecord']]",
84-
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRecordComponentNumber2']]"
84+
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathRecordComponentNumberCustomMax']]"
8585
+ "/OBJBLOCK/RECORD_DEF[./IDENT[@text='MyRecord']]/MODIFIERS",
86-
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRecordComponentNumber2']]"
86+
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathRecordComponentNumberCustomMax']]"
8787
+ "/OBJBLOCK/RECORD_DEF[./IDENT[@text='MyRecord']]/MODIFIERS"
8888
+ "/LITERAL_PUBLIC"
8989
);

src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/illegalidentifiername/SuppressionXpathRegressionIllegalIdentifierNameTestOne.java renamed to src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/illegalidentifiername/InputXpathIllegalIdentifierNameOne.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* default
77
*/
8-
public record SuppressionXpathRegressionIllegalIdentifierNameTestOne
8+
public record InputXpathIllegalIdentifierNameOne
99
(String string,
1010
String yield, // warn
1111
String otherString){

src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/illegalidentifiername/SuppressionXpathRegressionIllegalIdentifierNameTestTwo.java renamed to src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/illegalidentifiername/InputXpathIllegalIdentifierNameTwo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* default
77
*/
8-
public class SuppressionXpathRegressionIllegalIdentifierNameTestTwo {
8+
public class InputXpathIllegalIdentifierNameTwo {
99
int foo(int yield) { // warn
1010
return switch (yield) {
1111
case 1 -> 2;

src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/illegalinstantiation/SuppressionXpathRegressionIllegalInstantiationAnonymous.java renamed to src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/illegalinstantiation/InputXpathIllegalInstantiationAnonymous.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package org.checkstyle.suppressionxpathfilter.illegalinstantiation;
44

5-
public class SuppressionXpathRegressionIllegalInstantiationAnonymous {
5+
public class InputXpathIllegalInstantiationAnonymous {
66
int b = 5; // ok
77
class Inner{
88
public void test() {

0 commit comments

Comments
 (0)