Skip to content

Commit

Permalink
Issue #14715: Enforced new naming convention in IT area Four
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and rnveach committed Apr 2, 2024
1 parent 69f2e98 commit 8591ca2
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected String getCheckName() {
@Test
public void testProcessEnd() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceEnd.java"));
getPath("InputXpathGenericWhitespaceEnd.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -53,7 +53,7 @@ public void testProcessEnd() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionGenericWhitespaceEnd']]/OBJBLOCK"
+ "[./IDENT[@text='InputXpathGenericWhitespaceEnd']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='bad']]"
+ "/PARAMETERS/PARAMETER_DEF[./IDENT[@text='cls']]"
+ "/TYPE[./IDENT[@text='Class']]/TYPE_ARGUMENTS/GENERIC_END"
Expand All @@ -66,7 +66,7 @@ public void testProcessEnd() throws Exception {
@Test
public void testProcessNestedGenericsOne() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne.java"));
getPath("InputXpathGenericWhitespaceNestedOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -78,7 +78,7 @@ public void testProcessNestedGenericsOne() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne']]"
+ "@text='InputXpathGenericWhitespaceNestedOne']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS"
+ "/TYPE_PARAMETER[./IDENT[@text='E']]"
+ "/TYPE_UPPER_BOUNDS[./IDENT[@text='Enum']]/TYPE_ARGUMENTS/GENERIC_END"
Expand All @@ -91,7 +91,7 @@ public void testProcessNestedGenericsOne() throws Exception {
@Test
public void testProcessNestedGenericsTwo() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo.java"));
getPath("InputXpathGenericWhitespaceNestedTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -103,7 +103,7 @@ public void testProcessNestedGenericsTwo() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo']]"
+ "@text='InputXpathGenericWhitespaceNestedTwo']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS"
+ "/TYPE_PARAMETER[./IDENT[@text='E']]"
+ "/TYPE_UPPER_BOUNDS[./IDENT[@text='Enum']]/TYPE_ARGUMENTS/GENERIC_END"
Expand All @@ -116,7 +116,7 @@ public void testProcessNestedGenericsTwo() throws Exception {
@Test
public void testProcessNestedGenericsThree() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree.java"));
getPath("InputXpathGenericWhitespaceNestedThree.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -128,7 +128,7 @@ public void testProcessNestedGenericsThree() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree']]"
+ "@text='InputXpathGenericWhitespaceNestedThree']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS"
+ "/TYPE_PARAMETER[./IDENT[@text='E']]"
+ "/TYPE_UPPER_BOUNDS[./IDENT[@text='Enum']]/TYPE_ARGUMENTS/GENERIC_END"
Expand All @@ -141,7 +141,7 @@ public void testProcessNestedGenericsThree() throws Exception {
@Test
public void testProcessSingleGenericOne() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericOne.java"));
getPath("InputXpathGenericWhitespaceSingleOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -153,7 +153,7 @@ public void testProcessSingleGenericOne() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionGenericWhitespaceSingleGenericOne']]"
+ "@text='InputXpathGenericWhitespaceSingleOne']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/METHOD_CALL"
+ "/DOT[./IDENT[@text='Collections']]"
+ "/TYPE_ARGUMENTS/GENERIC_END"
Expand All @@ -166,7 +166,7 @@ public void testProcessSingleGenericOne() throws Exception {
@Test
public void testProcessSingleGenericTwo() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo.java"));
getPath("InputXpathGenericWhitespaceSingleTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -178,7 +178,7 @@ public void testProcessSingleGenericTwo() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo']]"
+ "@text='InputXpathGenericWhitespaceSingleTwo']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS/GENERIC_END"
);

Expand All @@ -189,7 +189,7 @@ public void testProcessSingleGenericTwo() throws Exception {
@Test
public void testProcessStartOne() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceStartOne.java"));
getPath("InputXpathGenericWhitespaceStartOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -201,10 +201,10 @@ public void testProcessStartOne() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartOne']]"
+ "[@text='InputXpathGenericWhitespaceStartOne']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartOne']]"
+ "[@text='InputXpathGenericWhitespaceStartOne']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS/GENERIC_START"
);

Expand All @@ -215,7 +215,7 @@ public void testProcessStartOne() throws Exception {
@Test
public void testProcessStartTwo() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceStartTwo.java"));
getPath("InputXpathGenericWhitespaceStartTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -227,12 +227,12 @@ public void testProcessStartTwo() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartTwo']]"
+ "[@text='InputXpathGenericWhitespaceStartTwo']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/PARAMETERS"
+ "/PARAMETER_DEF[./IDENT[@text='consumer']]"
+ "/TYPE[./IDENT[@text='Consumer']]/TYPE_ARGUMENTS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartTwo']]"
+ "[@text='InputXpathGenericWhitespaceStartTwo']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/PARAMETERS"
+ "/PARAMETER_DEF[./IDENT[@text='consumer']]"
+ "/TYPE[./IDENT[@text='Consumer']]/TYPE_ARGUMENTS/GENERIC_START"
Expand All @@ -245,7 +245,7 @@ public void testProcessStartTwo() throws Exception {
@Test
public void testProcessStartThree() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionGenericWhitespaceStartThree.java"));
getPath("InputXpathGenericWhitespaceStartThree.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(GenericWhitespaceCheck.class);
Expand All @@ -257,16 +257,16 @@ public void testProcessStartThree() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartThree']]"
+ "[@text='InputXpathGenericWhitespaceStartThree']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartThree']]"
+ "[@text='InputXpathGenericWhitespaceStartThree']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartThree']]"
+ "[@text='InputXpathGenericWhitespaceStartThree']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionGenericWhitespaceStartThree']]"
+ "[@text='InputXpathGenericWhitespaceStartThree']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS/GENERIC_START"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ protected String getCheckName() {
}

@Test
public void testOne() throws Exception {
public void testLambdaExpInMethodCall() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionHiddenFieldOne.java"));
new File(getPath("InputXpathHiddenFieldLambdaExpInMethodCall.java"));

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

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionHiddenFieldOne']]/OBJBLOCK"
+ "[./IDENT[@text='InputXpathHiddenFieldLambdaExpInMethodCall']]/OBJBLOCK"
+ "/INSTANCE_INIT/SLIST/EXPR/METHOD_CALL/ELIST/LAMBDA/PARAMETERS"
+ "/PARAMETER_DEF/IDENT[@text='value']"
);
Expand All @@ -62,9 +62,9 @@ public void testOne() throws Exception {
}

@Test
public void testTwo() throws Exception {
public void testMethodParam() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionHiddenFieldTwo.java"));
new File(getPath("InputXpathHiddenFieldMethodParam.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(HiddenFieldCheck.class);
Expand All @@ -76,7 +76,7 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionHiddenFieldTwo']]/OBJBLOCK"
+ "[./IDENT[@text='InputXpathHiddenFieldMethodParam']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='method']]/PARAMETERS/PARAMETER_DEF"
+ "/IDENT[@text='other']"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIllegalCatchOne.java"));
new File(getPath("InputXpathIllegalCatchOne.java"));

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

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIllegalCatchOne']]/OBJBLOCK"
+ "[./IDENT[@text='InputXpathIllegalCatchOne']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='fun']]/SLIST"
+ "/LITERAL_TRY/LITERAL_CATCH"
);
Expand All @@ -64,7 +64,7 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIllegalCatchTwo.java"));
new File(getPath("InputXpathIllegalCatchTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IllegalCatchCheck.class);
Expand All @@ -76,7 +76,7 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIllegalCatchTwo']]/OBJBLOCK"
+ "[./IDENT[@text='InputXpathIllegalCatchTwo']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='methodTwo']]/SLIST"
+ "/LITERAL_TRY/LITERAL_CATCH"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ protected String getCheckName() {
}

@Test
public void testOne() throws Exception {
public void testDefault() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIllegalImportOne.java"));
new File(getPath("InputXpathIllegalImportDefault.java"));
final DefaultConfiguration moduleConfig =
createModuleConfig(IllegalImportCheck.class);
moduleConfig.addProperty("illegalPkgs", "java.util");
Expand All @@ -57,9 +57,9 @@ public void testOne() throws Exception {
}

@Test
public void testTwo() throws Exception {
public void testStatic() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIllegalImportTwo.java"));
new File(getPath("InputXpathIllegalImportStatic.java"));
final DefaultConfiguration moduleConfig =
createModuleConfig(IllegalImportCheck.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collections;

public class SuppressionXpathRegressionGenericWhitespaceEnd {
public class InputXpathGenericWhitespaceEnd {
void bad(Class<? > cls) {//warn
}
void good(Class<?> cls) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

public class SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne {
public class InputXpathGenericWhitespaceNestedOne {
<E extends Enum<E>& Serializable> void bad() {//warn
}
<E extends Enum<E> & Serializable> void good() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

public class SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree {
public class InputXpathGenericWhitespaceNestedThree {
<E extends Enum<E> , X> void bad() {//warn
}
<E extends Enum<E>, X> void good() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

public class SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo {
public class InputXpathGenericWhitespaceNestedTwo {
<E extends Enum<E> & Serializable> void bad() {//warn
}
<E extends Enum<E> & Serializable> void good() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collections;

public class SuppressionXpathRegressionGenericWhitespaceSingleGenericOne {
public class InputXpathGenericWhitespaceSingleOne {
Object bad = Collections.<Object> emptySet();//warn
Object good = Collections.<Object>emptySet();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

public class SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo {
public class InputXpathGenericWhitespaceSingleTwo {
<E>void bad() {//warn
}
<E> void good() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collections;

public class SuppressionXpathRegressionGenericWhitespaceStartOne {
public class InputXpathGenericWhitespaceStartOne {
public<E> void bad() {//warn
}
public <E> void good() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collections;

public class SuppressionXpathRegressionGenericWhitespaceStartThree {
public class InputXpathGenericWhitespaceStartThree {
< E> void bad() {//warn
}
<E> void good() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.function.Consumer;

public class SuppressionXpathRegressionGenericWhitespaceStartTwo {
public class InputXpathGenericWhitespaceStartTwo {
public <E> void bad(Consumer <E> consumer) {//warn
}
public <E> void good(Consumer<E> consumer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Arrays;
import java.util.List;

public class SuppressionXpathRegressionHiddenFieldOne {
public class InputXpathHiddenFieldLambdaExpInMethodCall {
List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6);
Integer value = Integer.valueOf(1);
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.hiddenfield;

public class SuppressionXpathRegressionHiddenFieldTwo {
public class InputXpathHiddenFieldMethodParam {
static int someField;
static Object other = null;
Object field = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.illegalcatch;

public class SuppressionXpathRegressionIllegalCatchOne {
public class InputXpathIllegalCatchOne {
public void fun() {
try {
} catch (RuntimeException e) { // warn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.illegalcatch;

public class SuppressionXpathRegressionIllegalCatchTwo {
public class InputXpathIllegalCatchTwo {
public void methodOne() {
try {
foo();
Expand Down

0 comments on commit 8591ca2

Please sign in to comment.