Skip to content

Commit e20f9e2

Browse files
Kexin2000rnveach
authored andcommitted
Issue #14715: Enforce new naming convention on methodtypeparametername in IT area
1 parent d35128b commit e20f9e2

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected String getCheckName() {
4242
@Test
4343
public void test1() throws Exception {
4444
final File fileToProcess =
45-
new File(getPath("SuppressionXpathRegressionMethodTypeParameterName1.java"));
45+
new File(getPath("InputXpathMethodTypeParameterNameDefault.java"));
4646

4747
final DefaultConfiguration moduleConfig =
4848
createModuleConfig(MethodTypeParameterNameCheck.class);
@@ -54,11 +54,11 @@ public void test1() throws Exception {
5454

5555
final List<String> expectedXpathQueries = Arrays.asList(
5656
"/COMPILATION_UNIT/CLASS_DEF[./"
57-
+ "IDENT[@text='SuppressionXpathRegressionMethodTypeParameterName1']]"
57+
+ "IDENT[@text='InputXpathMethodTypeParameterNameDefault']]"
5858
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/TYPE_PARAMETERS"
5959
+ "/TYPE_PARAMETER[./IDENT[@text='TT']]", "/COMPILATION_UNIT"
6060
+ "/CLASS_DEF[./IDENT["
61-
+ "@text='SuppressionXpathRegressionMethodTypeParameterName1']]"
61+
+ "@text='InputXpathMethodTypeParameterNameDefault']]"
6262
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]"
6363
+ "/TYPE_PARAMETERS/TYPE_PARAMETER/IDENT[@text='TT']"
6464
);
@@ -69,7 +69,7 @@ public void test1() throws Exception {
6969
@Test
7070
public void test2() throws Exception {
7171
final File fileToProcess =
72-
new File(getPath("SuppressionXpathRegressionMethodTypeParameterName2.java"));
72+
new File(getPath("InputXpathMethodTypeParameterNameInner.java"));
7373

7474
final DefaultConfiguration moduleConfig =
7575
createModuleConfig(MethodTypeParameterNameCheck.class);
@@ -82,12 +82,12 @@ public void test2() throws Exception {
8282

8383
final List<String> expectedXpathQueries = Arrays.asList(
8484
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
85-
+ "@text='SuppressionXpathRegressionMethodTypeParameterName2']]"
85+
+ "@text='InputXpathMethodTypeParameterNameInner']]"
8686
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Junk']]/OBJBLOCK"
8787
+ "/METHOD_DEF[./IDENT[@text='foo']]/TYPE_PARAMETERS"
8888
+ "/TYPE_PARAMETER[./IDENT[@text='fo_']]", "/COMPILATION_UNIT"
8989
+ "/CLASS_DEF[./IDENT[@text="
90-
+ "'SuppressionXpathRegressionMethodTypeParameterName2']]"
90+
+ "'InputXpathMethodTypeParameterNameInner']]"
9191
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Junk']]/OBJBLOCK"
9292
+ "/METHOD_DEF[./IDENT[@text='foo']]/TYPE_PARAMETERS"
9393
+ "/TYPE_PARAMETER/IDENT[@text='fo_']"
@@ -99,7 +99,7 @@ public void test2() throws Exception {
9999
@Test
100100
public void test3() throws Exception {
101101
final File fileToProcess =
102-
new File(getPath("SuppressionXpathRegressionMethodTypeParameterName3.java"));
102+
new File(getPath("InputXpathMethodTypeParameterNameLowercase.java"));
103103

104104
final DefaultConfiguration moduleConfig =
105105
createModuleConfig(MethodTypeParameterNameCheck.class);
@@ -112,11 +112,11 @@ public void test3() throws Exception {
112112

113113
final List<String> expectedXpathQueries = Arrays.asList(
114114
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
115-
+ "[@text='SuppressionXpathRegressionMethodTypeParameterName3']]"
115+
+ "[@text='InputXpathMethodTypeParameterNameLowercase']]"
116116
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myMethod']]/TYPE_PARAMETERS"
117117
+ "/TYPE_PARAMETER[./IDENT[@text='a_a']]", "/COMPILATION_UNIT"
118118
+ "/CLASS_DEF[./IDENT[@text="
119-
+ "'SuppressionXpathRegressionMethodTypeParameterName3']]"
119+
+ "'InputXpathMethodTypeParameterNameLowercase']]"
120120
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myMethod']]"
121121
+ "/TYPE_PARAMETERS/TYPE_PARAMETER/IDENT[@text='a_a']"
122122
);
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package org.checkstyle.suppressionxpathfilter.methodtypeparametername;
22

3-
public class SuppressionXpathRegressionMethodTypeParameterName1{
3+
public class InputXpathMethodTypeParameterNameDefault {
44
public <TT> void foo() { } // warn
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.checkstyle.suppressionxpathfilter.methodtypeparametername;
22

3-
public class SuppressionXpathRegressionMethodTypeParameterName2 <T>{
3+
public class InputXpathMethodTypeParameterNameInner<T>{
44

55
static class Junk <T> {
66
<fo_ extends T> void foo() { // warn
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.List;
44

5-
public class SuppressionXpathRegressionMethodTypeParameterName3<T> {
5+
public class InputXpathMethodTypeParameterNameLowercase<T> {
66

77
<a_a> a_a myMethod(List<? super T> list) {return null;} // warn
88

src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ public class XpathRegressionTest extends AbstractModuleTestSupport {
181181
"MethodLength",
182182
"MethodName",
183183
"MethodParamPad",
184-
"MethodTypeParameterName",
185184
"MissingCtor",
186185
"MissingJavadocMethod",
187186
"MissingJavadocPackage",

0 commit comments

Comments
 (0)