Skip to content

Commit

Permalink
Issue #14715: Enforced new naming convention in IT area Eight
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and rnveach committed Apr 6, 2024
1 parent 5e2a2f0 commit e30260d
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected String getCheckName() {
@Test
public void testDefault() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall.java"));
"InputXpathAvoidNoArgumentSuperConstructorCallDefault.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(CLASS);
Expand All @@ -54,9 +54,9 @@ public void testDefault() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall']]"
+ "[@text='InputXpathAvoidNoArgumentSuperConstructorCallDefault']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall']]"
+ "@text='InputXpathAvoidNoArgumentSuperConstructorCallDefault']]"
+ "/SLIST/SUPER_CTOR_CALL"
);

Expand All @@ -66,7 +66,7 @@ public void testDefault() throws Exception {
@Test
public void testInnerClass() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCallInnerClass.java"
"InputXpathAvoidNoArgumentSuperConstructorCallInnerClass.java"
));

final DefaultConfiguration moduleConfig =
Expand All @@ -79,7 +79,7 @@ public void testInnerClass() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text="
+ "'SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCallInnerClass']]"
+ "'InputXpathAvoidNoArgumentSuperConstructorCallInnerClass']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]"
+ "/SLIST/CLASS_DEF[./IDENT[@text='Inner']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT[@text='Inner']]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAvoidStarImport1.java"));
"InputXpathAvoidStarImportOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(CLASS);
Expand All @@ -62,7 +62,7 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAvoidStarImport2.java"));
"InputXpathAvoidStarImportTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(CLASS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAvoidStaticImport1.java"));
"InputXpathAvoidStaticImportOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(CLASS);
Expand All @@ -62,7 +62,7 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAvoidStaticImport2.java"));
"InputXpathAvoidStaticImportTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(CLASS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ protected String getCheckName() {
}

@Test
public void testMethodOne() throws Exception {
public void testCatchBlock() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityOne.java"));
new File(getPath("InputXpathBooleanExpressionComplexityCatchBlock.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(BooleanExpressionComplexityCheck.class);
Expand All @@ -51,7 +51,7 @@ public void testMethodOne() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionBooleanExpressionComplexityOne']]"
+ "[@text='InputXpathBooleanExpressionComplexityCatchBlock']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodOne']]/SLIST"
+ "/LITERAL_TRY/LITERAL_CATCH/SLIST/VARIABLE_DEF"
+ "[./IDENT[@text='d']]/ASSIGN"
Expand All @@ -62,9 +62,9 @@ public void testMethodOne() throws Exception {
}

@Test
public void testMethodTwo() throws Exception {
public void testClassFields() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityTwo.java"));
new File(getPath("InputXpathBooleanExpressionComplexityClassFields.java"));

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

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionBooleanExpressionComplexityTwo']]"
+ "@text='InputXpathBooleanExpressionComplexityClassFields']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodTwo']]/SLIST/VARIABLE_DEF"
+ "[./IDENT[@text='d']]/ASSIGN"
);
Expand All @@ -86,10 +86,9 @@ public void testMethodTwo() throws Exception {
}

@Test
public void testMethodThree() throws Exception {
public void testConditionals() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionBoolean"
+ "ExpressionComplexityThree.java"));
new File(getPath("InputXpathBooleanExpressionComplexityConditionals.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(BooleanExpressionComplexityCheck.class);
Expand All @@ -101,7 +100,7 @@ public void testMethodThree() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionBooleanExpressionComplexityThree']]"
+ "@text='InputXpathBooleanExpressionComplexityConditionals']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodThree']]/SLIST/LITERAL_IF"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void testSimple() throws Exception {
createModuleConfig(CatchParameterNameCheck.class);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameSimple.java"));
new File(getPath("InputXpathCatchParameterNameSimple.java"));

final String[] expectedViolation = {
"6:28: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -55,7 +55,7 @@ public void testSimple() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameSimple']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameSimple']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]"
+ "/SLIST/LITERAL_TRY/LITERAL_CATCH/PARAMETER_DEF/IDENT[@text='e1']"
);
Expand All @@ -71,7 +71,7 @@ public void testNested() throws Exception {
createModuleConfig(CatchParameterNameCheck.class);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameNested.java"));
new File(getPath("InputXpathCatchParameterNameNested.java"));

final String[] expectedViolation = {
"9:40: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -80,7 +80,7 @@ public void testNested() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameNested']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameNested']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='NestedClass']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]"
+ "/SLIST/LITERAL_IF/SLIST"
Expand All @@ -99,7 +99,7 @@ public void testStaticInit() throws Exception {
moduleConfig.addProperty("format", pattern);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameStaticInit.java"));
new File(getPath("InputXpathCatchParameterNameStaticInit.java"));

final String[] expectedViolation = {
"7:32: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -108,7 +108,7 @@ public void testStaticInit() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameStaticInit']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameStaticInit']]"
+ "/OBJBLOCK/STATIC_INIT/SLIST"
+ "/LITERAL_DO/SLIST/LITERAL_TRY/LITERAL_CATCH/PARAMETER_DEF/IDENT[@text='Ex']"
);
Expand All @@ -125,7 +125,7 @@ public void testAnonymous() throws Exception {
moduleConfig.addProperty("format", pattern);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameAnonymous.java"));
new File(getPath("InputXpathCatchParameterNameAnonymous.java"));

final String[] expectedViolation = {
"12:40: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -134,7 +134,7 @@ public void testAnonymous() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameAnonymous']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameAnonymous']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]"
+ "/OBJBLOCK/CTOR_DEF[./IDENT[@text='InnerClass']]"
+ "/SLIST/EXPR/LITERAL_NEW[./IDENT[@text='Runnable']]"
Expand All @@ -154,7 +154,7 @@ public void testLambda() throws Exception {
moduleConfig.addProperty("format", pattern);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameLambda.java"));
new File(getPath("InputXpathCatchParameterNameLambda.java"));

final String[] expectedViolation = {
"12:32: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -163,7 +163,7 @@ public void testLambda() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameLambda']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameLambda']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='lambdaFunction']]"
+ "/ASSIGN/LAMBDA[./IDENT[@text='a']]"
+ "/SLIST/LITERAL_FOR/SLIST/LITERAL_TRY/LITERAL_CATCH"
Expand All @@ -182,7 +182,7 @@ public void testEnum() throws Exception {
moduleConfig.addProperty("format", pattern);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameEnum.java"));
new File(getPath("InputXpathCatchParameterNameEnum.java"));

final String[] expectedViolation = {
"10:40: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -191,7 +191,7 @@ public void testEnum() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/ENUM_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameEnum']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameEnum']]"
+ "/OBJBLOCK/ENUM_CONSTANT_DEF[./IDENT[@text='VALUE']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]"
+ "/SLIST/LITERAL_SWITCH/CASE_GROUP/SLIST/LITERAL_TRY/LITERAL_CATCH/"
Expand All @@ -210,7 +210,7 @@ public void testInterface() throws Exception {
moduleConfig.addProperty("format", pattern);

final File fileToProcess =
new File(getPath("SuppressionXpathRegressionCatchParameterNameInterface.java"));
new File(getPath("InputXpathCatchParameterNameInterface.java"));

final String[] expectedViolation = {
"7:32: " + getCheckMessage(CatchParameterNameCheck.class,
Expand All @@ -219,7 +219,7 @@ public void testInterface() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/INTERFACE_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameInterface']]"
+ "[./IDENT[@text='InputXpathCatchParameterNameInterface']]"
+ "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='InnerInterface']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]"
+ "/SLIST/LITERAL_TRY/LITERAL_CATCH/PARAMETER_DEF/IDENT[@text='EX']"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.checkstyle.suppressionxpathfilter.avoidnoargumentsuperconstructorcall;

public class InputXpathAvoidNoArgumentSuperConstructorCallDefault {
InputXpathAvoidNoArgumentSuperConstructorCallDefault() {
super(); //warn
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.avoidnoargumentsuperconstructorcall;

public class SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCallInnerClass {
public class InputXpathAvoidNoArgumentSuperConstructorCallInnerClass {
public void test() {
class Inner {
Inner() {
Expand Down

This file was deleted.

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

import static javax.swing.WindowConstants.*; // warn

public class SuppressionXpathRegressionAvoidStarImport1 {
public class InputXpathAvoidStarImportOne {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import java.util.Scanner;
import java.io.*; // warn

public class SuppressionXpathRegressionAvoidStarImport2 {
public class InputXpathAvoidStarImportTwo {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

import static javax.swing.WindowConstants.*; // warn

public class SuppressionXpathRegressionAvoidStaticImport1 {
public class InputXpathAvoidStaticImportOne {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

import static java.io.File.createTempFile; // warn

public class SuppressionXpathRegressionAvoidStaticImport2 {
public class InputXpathAvoidStaticImportTwo {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.booleanexpressioncomplexity;

public class SuppressionXpathRegressionBooleanExpressionComplexityOne {
public class InputXpathBooleanExpressionComplexityCatchBlock {
public boolean methodOne() {
boolean a = true;
boolean b = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.booleanexpressioncomplexity;

public class SuppressionXpathRegressionBooleanExpressionComplexityTwo {
public class InputXpathBooleanExpressionComplexityClassFields {
public void methodTwo() {
boolean a = true;
boolean b = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.booleanexpressioncomplexity;

public class SuppressionXpathRegressionBooleanExpressionComplexityThree {
public class InputXpathBooleanExpressionComplexityConditionals {
public void methodThree() {
boolean a = true;
boolean b = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.catchparametername;

public class SuppressionXpathRegressionCatchParameterNameAnonymous {
public class InputXpathCatchParameterNameAnonymous {
class InnerClass {
InnerClass() {
new Runnable() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.catchparametername;

public enum SuppressionXpathRegressionCatchParameterNameEnum {
public enum InputXpathCatchParameterNameEnum {
VALUE {
@Override
public void method(String op) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.catchparametername;

interface SuppressionXpathRegressionCatchParameterNameInterface {
interface InputXpathCatchParameterNameInterface {
interface InnerInterface {
default void method() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.function.Function;

abstract class SuppressionXpathRegressionCatchParameterNameLambda {
abstract class InputXpathCatchParameterNameLambda {
abstract void abstracMethod();

private final Function<Integer, Integer> lambdaFunction = a -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.catchparametername;

public class SuppressionXpathRegressionCatchParameterNameNested {
public class InputXpathCatchParameterNameNested {
public static class NestedClass {
void method() {
if (true) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.catchparametername;

public class SuppressionXpathRegressionCatchParameterNameSimple {
public class InputXpathCatchParameterNameSimple {
void method() {
try {
} catch (Exception e1) { // warn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.catchparametername;

public class SuppressionXpathRegressionCatchParameterNameStaticInit {
public class InputXpathCatchParameterNameStaticInit {
static {
do {
try {
Expand Down

0 comments on commit e30260d

Please sign in to comment.