Skip to content

Commit

Permalink
Issue #14715: Enforced new naming convention in IT area 11
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and rnveach committed Apr 13, 2024
1 parent 69337c7 commit a11afaa
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportControlOne.java"));
new File(getPath("InputXpathImportControlOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportControlCheck.class);
moduleConfig.addProperty("file", getPath(
"SuppressionXpathRegressionImportControlOne.xml"));
"InputXpathImportControlOne.xml"));

final String[] expectedViolation = {
"3:1: " + getCheckMessage(ImportControlCheck.class,
Expand All @@ -64,12 +64,12 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportControlTwo.java"));
new File(getPath("InputXpathImportControlTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportControlCheck.class);
moduleConfig.addProperty("file", getPath(
"SuppressionXpathRegressionImportControlTwo.xml"));
"InputXpathImportControlTwo.xml"));

final String[] expectedViolation = {
"1:1: " + getCheckMessage(ImportControlCheck.class,
Expand All @@ -87,7 +87,7 @@ public void testTwo() throws Exception {
@Test
public void testThree() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportControlThree.java"));
new File(getPath("InputXpathImportControlThree.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportControlCheck.class);
Expand All @@ -108,12 +108,12 @@ public void testThree() throws Exception {
@Test
public void testFour() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportControlFour.java"));
new File(getPath("InputXpathImportControlFour.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportControlCheck.class);
moduleConfig.addProperty("file",
getPath("SuppressionXpathRegressionImportControlFour.xml"));
getPath("InputXpathImportControlFour.xml"));

final String[] expectedViolation = {
"4:1: " + getCheckMessage(ImportControlCheck.class,
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("SuppressionXpathRegressionImportOrderOne.java"));
new File(getPath("InputXpathImportOrderOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportOrderCheck.class);
Expand All @@ -61,7 +61,7 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportOrderTwo.java"));
new File(getPath("InputXpathImportOrderTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportOrderCheck.class);
Expand All @@ -82,7 +82,7 @@ public void testTwo() throws Exception {
@Test
public void testThree() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportOrderThree.java"));
new File(getPath("InputXpathImportOrderThree.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportOrderCheck.class);
Expand All @@ -105,7 +105,7 @@ public void testThree() throws Exception {
@Test
public void testFour() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportOrderFour.java"));
new File(getPath("InputXpathImportOrderFour.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportOrderCheck.class);
Expand All @@ -127,7 +127,7 @@ public void testFour() throws Exception {
@Test
public void testFive() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionImportOrderFive.java"));
new File(getPath("InputXpathImportOrderFive.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(ImportOrderCheck.class);
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("SuppressionXpathRegressionIndentationTestOne.java"));
new File(getPath("InputXpathIndentationDefault.java"));

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

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestOne']]"
+ "[./IDENT[@text='InputXpathIndentationDefault']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='wrongIntend']]",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestOne']]"
+ "[./IDENT[@text='InputXpathIndentationDefault']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='wrongIntend']]/MODIFIERS",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestOne']]"
+ "[./IDENT[@text='InputXpathIndentationDefault']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='wrongIntend']]/TYPE",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestOne']]"
+ "[./IDENT[@text='InputXpathIndentationDefault']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='wrongIntend']]/TYPE/LITERAL_VOID"
);

Expand All @@ -75,7 +75,7 @@ public void testOne() throws Exception {
@Test
public void testBasicOffset() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIndentationTestTwo.java"));
new File(getPath("InputXpathIndentationBasicOffset.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IndentationCheck.class);
Expand All @@ -95,19 +95,19 @@ public void testBasicOffset() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestTwo']]"
+ "[./IDENT[@text='InputXpathIndentationBasicOffset']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestTwo']]"
+ "[./IDENT[@text='InputXpathIndentationBasicOffset']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/MODIFIERS",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestTwo']]"
+ "[./IDENT[@text='InputXpathIndentationBasicOffset']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestTwo']]"
+ "[./IDENT[@text='InputXpathIndentationBasicOffset']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE/LITERAL_VOID"
);

Expand All @@ -118,7 +118,7 @@ public void testBasicOffset() throws Exception {
@Test
public void testCaseIndent() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIndentationTestThree.java"));
new File(getPath("InputXpathIndentationSwitchCase.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IndentationCheck.class);
Expand All @@ -138,12 +138,12 @@ public void testCaseIndent() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestThree']]"
+ "[./IDENT[@text='InputXpathIndentationSwitchCase']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/"
+ "CASE_GROUP",

"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationTestThree']]"
+ "[./IDENT[@text='InputXpathIndentationSwitchCase']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/"
+ "CASE_GROUP/LITERAL_CASE"
);
Expand All @@ -153,9 +153,9 @@ public void testCaseIndent() throws Exception {
}

@Test
public void testLambda() throws Exception {
public void testLambdaOne() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIndentationLambdaTest1.java"));
new File(getPath("InputXpathIndentationLambdaOne.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IndentationCheck.class);
Expand All @@ -175,7 +175,7 @@ public void testLambda() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationLambdaTest1"
+ "[./IDENT[@text='InputXpathIndentationLambdaOne"
+ "']]/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF"
+ "[./IDENT[@text='getA']]/ASSIGN/LAMBDA/LPAREN"
);
Expand All @@ -185,9 +185,9 @@ public void testLambda() throws Exception {
}

@Test
public void testLambda2() throws Exception {
public void testLambdaTwo() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIndentationLambdaTest2.java"));
new File(getPath("InputXpathIndentationLambdaTwo.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IndentationCheck.class);
Expand All @@ -207,7 +207,7 @@ public void testLambda2() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationLambdaTest2']]"
+ "[./IDENT[@text='InputXpathIndentationLambdaTwo']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF["
+ "./IDENT[@text='div']]/ASSIGN/LAMBDA/SLIST/LITERAL_RETURN"
);
Expand All @@ -219,7 +219,7 @@ public void testLambda2() throws Exception {
@Test
public void testIfWithNoCurlies() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIndentationIfWithoutCurly.java"));
new File(getPath("InputXpathIndentationIfWithoutCurly.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IndentationCheck.class);
Expand All @@ -240,7 +240,7 @@ public void testIfWithNoCurlies() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationIfWithoutCurly']]"
+ "[./IDENT[@text='InputXpathIndentationIfWithoutCurly']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/EXPR/"
+ "METHOD_CALL/IDENT[@text='e']"
);
Expand All @@ -252,7 +252,7 @@ public void testIfWithNoCurlies() throws Exception {
@Test
public void testElseWithNoCurlies() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionIndentationElseWithoutCurly.java"));
new File(getPath("InputXpathIndentationElseWithoutCurly.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(IndentationCheck.class);
Expand All @@ -273,7 +273,7 @@ public void testElseWithNoCurlies() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionIndentationElseWithoutCurly']]"
+ "[./IDENT[@text='InputXpathIndentationElseWithoutCurly']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/LITERAL_ELSE"
+ "/EXPR/METHOD_CALL/IDENT[@text='exp']"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import java.util.Arrays;


public class SuppressionXpathRegressionImportControlFour {
public class InputXpathImportControlFour {

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

import java.util.Scanner; //warn

public class SuppressionXpathRegressionImportControlOne {
public class InputXpathImportControlOne {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.checkstyle.suppressionxpathfilter.importcontrol; //warn

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

import java.util.Scanner;

public class SuppressionXpathRegressionImportControlTwo {
public class InputXpathImportControlTwo {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import static org.junit.After.*;
import java.util.Date; // warn

public class SuppressionXpathRegressionImportOrderFive {
public class InputXpathImportOrderFive {
// code
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import java.util.Set;
import static java.lang.Math.PI; // warn

public class SuppressionXpathRegressionImportOrderFour {
public class InputXpathImportOrderFour {
// code
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import static java.lang.Math.PI;
import java.util.Set; // warn

public class SuppressionXpathRegressionImportOrderOne {
public class InputXpathImportOrderOne {
// code
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import java.io.*;
import org.junit.*; // warn

public class SuppressionXpathRegressionImportOrderThree {
public class InputXpathImportOrderThree {
// code
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

import java.util.Set; // warn

public class SuppressionXpathRegressionImportOrderTwo {
public class InputXpathImportOrderTwo {
// code
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package org.checkstyle.suppressionxpathfilter.indentation;

public class SuppressionXpathRegressionIndentationTestTwo {
public class InputXpathIndentationBasicOffset {
void test() {} // warn
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.indentation;

public class SuppressionXpathRegressionIndentationTestOne {
public class InputXpathIndentationDefault {
void wrongIntend() { // warn
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.indentation;

public class SuppressionXpathRegressionIndentationElseWithoutCurly {
public class InputXpathIndentationElseWithoutCurly {
void test() {
if (true)
exp();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.indentation;

public class SuppressionXpathRegressionIndentationIfWithoutCurly {
public class InputXpathIndentationIfWithoutCurly {
void test() {
if (true)
e();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.indentation;

public class SuppressionXpathRegressionIndentationLambdaTest1 {
public class InputXpathIndentationLambdaOne {
void test() {
MyLambda getA =
(a) -> a; // warn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface MyLambdaInterface {
int foo(int a, int b);
};

public class SuppressionXpathRegressionIndentationLambdaTest2 {
public class InputXpathIndentationLambdaTwo {
void test() {
MyLambdaInterface div = (a, b)
-> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.checkstyle.suppressionxpathfilter.indentation;

public class SuppressionXpathRegressionIndentationTestThree {
public class InputXpathIndentationSwitchCase {
void test() {
int key = 5;
switch (key) {
Expand Down
Loading

0 comments on commit a11afaa

Please sign in to comment.