Skip to content

Commit

Permalink
Issue #14715: Enforced new naming convention in IT area 16
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 committed Apr 15, 2024
1 parent 86195e0 commit 5b79be4
Show file tree
Hide file tree
Showing 30 changed files with 112 additions and 118 deletions.
Expand Up @@ -40,7 +40,7 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIllegalTypeOne.java"));
new File(getPath("InputXpathIllegalTypeOne.java"));
final DefaultConfiguration moduleConfig =
createModuleConfig(IllegalTypeCheck.class);
moduleConfig.addProperty("tokens", "METHOD_DEF");
Expand All @@ -50,7 +50,7 @@ public void testOne() throws Exception {
};
final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT"
+ "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTypeOne']]"
+ "/CLASS_DEF[./IDENT[@text='InputXpathIllegalTypeOne']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/TYPE_PARAMETER"
+ "[./IDENT[@text='T']]/TYPE_UPPER_BOUNDS/DOT"
+ "[./IDENT[@text='HashSet']]/DOT/IDENT[@text='java']"
Expand All @@ -63,7 +63,7 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIllegalTypeTwo.java"));
new File(getPath("InputXpathIllegalTypeTwo.java"));
final DefaultConfiguration moduleConfig =
createModuleConfig(IllegalTypeCheck.class);

Expand All @@ -74,7 +74,7 @@ public void testTwo() throws Exception {
IllegalTypeCheck.MSG_KEY, "Boolean"),
};
final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTypeTwo']"
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathIllegalTypeTwo']"
+ "]/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/"
+ "TYPE_PARAMETER[./IDENT[@text='T']]/TYPE_UPPER_BOUNDS/IDENT[@text='Boolean']"
);
Expand Down
Expand Up @@ -38,9 +38,9 @@ protected String getCheckName() {
}

@Test
public void testFile1() throws Exception {
public void testInnerAssignment() throws Exception {
final File fileToProcess = new
File(getPath("SuppressionXpathRegressionInnerAssignment1.java"));
File(getPath("InputXpathInnerAssignment.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class);

Expand All @@ -50,7 +50,7 @@ public void testFile1() throws Exception {

final List<String> expectedXpathQueries = List.of(
"/COMPILATION_UNIT"
+ "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInnerAssignment1']]"
+ "/CLASS_DEF[./IDENT[@text='InputXpathInnerAssignment']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]"
+ "/SLIST/EXPR/ASSIGN[./IDENT[@text='a']]/ASSIGN[./IDENT[@text='b']]"
);
Expand All @@ -59,9 +59,9 @@ public void testFile1() throws Exception {
}

@Test
public void testFile2() throws Exception {
public void testArrays() throws Exception {
final File fileToProcess = new
File(getPath("SuppressionXpathRegressionInnerAssignment2.java"));
File(getPath("InputXpathInnerAssignmentArrays.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class);

Expand All @@ -71,12 +71,12 @@ public void testFile2() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT"
+ "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInnerAssignment2']]"
+ "/CLASS_DEF[./IDENT[@text='InputXpathInnerAssignmentArrays']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]"
+ "/SLIST/VARIABLE_DEF[./IDENT[@text='doubleArray']]"
+ "/ASSIGN/EXPR/LITERAL_NEW/ARRAY_INIT/EXPR[./ASSIGN/IDENT[@text='myDouble']]",
"/COMPILATION_UNIT"
+ "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInnerAssignment2']]"
+ "/CLASS_DEF[./IDENT[@text='InputXpathInnerAssignmentArrays']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]/"
+ "SLIST/VARIABLE_DEF[./IDENT[@text='doubleArray']]"
+ "/ASSIGN/EXPR/LITERAL_NEW/ARRAY_INIT/EXPR/ASSIGN[./IDENT[@text='myDouble']]"
Expand Down
Expand Up @@ -42,7 +42,7 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionInnerTypeLastOne.java"));
new File(getPath("InputXpathInnerTypeLastOne.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(InnerTypeLastCheck.class);

Expand All @@ -52,18 +52,18 @@ public void testOne() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastOne']]"
+ "[@text='InputXpathInnerTypeLastOne']]"
+ "/OBJBLOCK/CTOR_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionInnerTypeLastOne']]",
+ "[./IDENT[@text='InputXpathInnerTypeLastOne']]",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastOne']]"
+ "[@text='InputXpathInnerTypeLastOne']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastOne']]"
+ "[@text='InputXpathInnerTypeLastOne']]"
+ "/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastOne']]"
+ "[@text='InputXpathInnerTypeLastOne']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastOne']]"
+ "[@text='InputXpathInnerTypeLastOne']]"
+ "/MODIFIERS/LITERAL_PUBLIC"
);

Expand All @@ -75,7 +75,7 @@ public void testOne() throws Exception {
public void testTwo() throws Exception {

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionInnerTypeLastTwo.java"));
new File(getPath("InputXpathInnerTypeLastTwo.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(InnerTypeLastCheck.class);

Expand All @@ -85,16 +85,16 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastTwo']]"
+ "[@text='InputXpathInnerTypeLastTwo']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Inner']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='innerMethod']]",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastTwo']]"
+ "[@text='InputXpathInnerTypeLastTwo']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Inner']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT"
+ "[@text='innerMethod']]/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastTwo']]"
+ "[@text='InputXpathInnerTypeLastTwo']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='Inner']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT"
+ "[@text='innerMethod']]/MODIFIERS/LITERAL_PUBLIC"
Expand All @@ -109,7 +109,7 @@ public void testTwo() throws Exception {
public void testThree() throws Exception {

final File fileToProcess = new File(
getPath("SuppressionXpathRegressionInnerTypeLastThree.java"));
getPath("InputXpathInnerTypeLastThree.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(InnerTypeLastCheck.class);

Expand All @@ -119,18 +119,18 @@ public void testThree() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastThree']]"
+ "[@text='InputXpathInnerTypeLastThree']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastThree']]",
+ "[@text='InputXpathInnerTypeLastThree']]",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastThree']]"
+ "[@text='InputXpathInnerTypeLastThree']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastThree']]"
+ "[@text='InputXpathInnerTypeLastThree']]"
+ "/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastThree']]"
+ "[@text='InputXpathInnerTypeLastThree']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInnerTypeLastThree']]"
+ "[@text='InputXpathInnerTypeLastThree']]"
+ "/MODIFIERS/LITERAL_PUBLIC"
);

Expand Down
Expand Up @@ -38,9 +38,9 @@ protected String getCheckName() {
}

@Test
public void testOne() throws Exception {
public void testAllowMarker() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionInterfaceIsType1.java"));
"InputXpathInterfaceIsTypeAllowMarker.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(InterfaceIsTypeCheck.class);
Expand All @@ -52,11 +52,11 @@ public void testOne() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionInterfaceIsType1']]",
+ "@text='InputXpathInterfaceIsTypeAllowMarker']]",
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionInterfaceIsType1']]/MODIFIERS",
+ "@text='InputXpathInterfaceIsTypeAllowMarker']]/MODIFIERS",
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionInterfaceIsType1']]"
+ "@text='InputXpathInterfaceIsTypeAllowMarker']]"
+ "/MODIFIERS/LITERAL_PUBLIC"
);

Expand All @@ -65,9 +65,9 @@ public void testOne() throws Exception {
}

@Test
public void testTwo() throws Exception {
public void testAllowMarkerFalse() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionInterfaceIsType2.java"));
"InputXpathInterfaceIsType.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(InterfaceIsTypeCheck.class);
Expand All @@ -81,11 +81,11 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionInterfaceIsType2']]",
+ "@text='InputXpathInterfaceIsType']]",
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionInterfaceIsType2']]/MODIFIERS",
+ "@text='InputXpathInterfaceIsType']]/MODIFIERS",
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionInterfaceIsType2']]"
+ "@text='InputXpathInterfaceIsType']]"
+ "/MODIFIERS/LITERAL_PUBLIC"
);

Expand Down
Expand Up @@ -36,9 +36,9 @@ protected String getCheckName() {
}

@Test
public void testOne() throws Exception {
public void testField() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier1.java")
getPath("InputXpathInterfaceMemberImpliedModifierField.java")
);

final DefaultConfiguration moduleConfig =
Expand All @@ -51,16 +51,16 @@ public void testOne() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier1']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierField']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='str']]",

"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier1']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierField']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='str']]"
+ "/MODIFIERS",

"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier1']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierField']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='str']]"
+ "/MODIFIERS/LITERAL_PUBLIC"
);
Expand All @@ -69,9 +69,9 @@ public void testOne() throws Exception {
}

@Test
public void testTwo() throws Exception {
public void testMethod() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier2.java")
getPath("InputXpathInterfaceMemberImpliedModifierMethod.java")
);

final DefaultConfiguration moduleConfig =
Expand All @@ -84,16 +84,16 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier2']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierMethod']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='setData']]",

"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier2']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierMethod']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='setData']]"
+ "/MODIFIERS",

"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier2']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierMethod']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='setData']]"
+ "/MODIFIERS/ABSTRACT"
);
Expand All @@ -102,9 +102,9 @@ public void testTwo() throws Exception {
}

@Test
public void testThree() throws Exception {
public void testInner() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier3.java")
getPath("InputXpathInterfaceMemberImpliedModifierInner.java")
);

final DefaultConfiguration moduleConfig =
Expand All @@ -117,16 +117,16 @@ public void testThree() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier3']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierInner']]"
+ "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Data']]",

"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier3']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierInner']]"
+ "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Data']]"
+ "/MODIFIERS",

"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionInterfaceMemberImpliedModifier3']]"
+ "[@text='InputXpathInterfaceMemberImpliedModifierInner']]"
+ "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Data']]"
+ "/MODIFIERS/LITERAL_PUBLIC"
);
Expand Down

0 comments on commit 5b79be4

Please sign in to comment.