Skip to content

Commit

Permalink
Issue #14715: Enforced new naming convention in IT area One
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and romani committed Mar 28, 2024
1 parent f4b7158 commit d35128b
Show file tree
Hide file tree
Showing 47 changed files with 185 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected String getCheckName() {
@Test
public void testAnnotation() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameAnnotation.java"));
"InputXpathAbbreviationAsWordInNameAnnotation.java"));

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

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameAnnotation']]"
+ "@text='InputXpathAbbreviationAsWordInNameAnnotation']]"
+ "/OBJBLOCK/ANNOTATION_DEF/IDENT[@text='ANNOTATION']"
);

Expand All @@ -63,7 +63,7 @@ public void testAnnotation() throws Exception {
@Test
public void testAnnotationField() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField.java"));
"InputXpathAbbreviationAsWordInNameAnnotationField.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -75,7 +75,7 @@ public void testAnnotationField() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/ANNOTATION_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField']]"
+ "@text='InputXpathAbbreviationAsWordInNameAnnotationField']]"
+ "/OBJBLOCK/ANNOTATION_FIELD_DEF/IDENT[@text='ANNOTATION_FIELD']"
);

Expand All @@ -86,7 +86,7 @@ public void testAnnotationField() throws Exception {
@Test
public void testClass() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameClass.java"));
"InputXpathAbbreviationAsWordInNameClass.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -98,7 +98,7 @@ public void testClass() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameClass']]"
+ "@text='InputXpathAbbreviationAsWordInNameClass']]"
+ "/OBJBLOCK/CLASS_DEF/IDENT[@text='CLASS']"
);

Expand All @@ -109,7 +109,7 @@ public void testClass() throws Exception {
@Test
public void testEnum() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameEnum.java"));
"InputXpathAbbreviationAsWordInNameEnum.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -121,7 +121,7 @@ public void testEnum() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameEnum']]"
+ "@text='InputXpathAbbreviationAsWordInNameEnum']]"
+ "/OBJBLOCK/ENUM_DEF/IDENT[@text='ENUMERATION']"
);

Expand All @@ -132,7 +132,7 @@ public void testEnum() throws Exception {
@Test
public void testField() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameField.java"));
"InputXpathAbbreviationAsWordInNameField.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -144,7 +144,7 @@ public void testField() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameField']]"
+ "@text='InputXpathAbbreviationAsWordInNameField']]"
+ "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='FIELD']"
);

Expand All @@ -155,7 +155,7 @@ public void testField() throws Exception {
@Test
public void testInterface() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameInterface.java"));
"InputXpathAbbreviationAsWordInNameInterface.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -167,7 +167,7 @@ public void testInterface() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameInterface']]"
+ "@text='InputXpathAbbreviationAsWordInNameInterface']]"
+ "/OBJBLOCK/INTERFACE_DEF/IDENT[@text='INTERFACE']"
);

Expand All @@ -178,7 +178,7 @@ public void testInterface() throws Exception {
@Test
public void testMethod() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameMethod.java"));
"InputXpathAbbreviationAsWordInNameMethod.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -190,7 +190,7 @@ public void testMethod() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameMethod']]"
+ "@text='InputXpathAbbreviationAsWordInNameMethod']]"
+ "/OBJBLOCK/METHOD_DEF/IDENT[@text='METHOD']"
);

Expand All @@ -201,7 +201,7 @@ public void testMethod() throws Exception {
@Test
public void testParameter() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameParameter.java"));
"InputXpathAbbreviationAsWordInNameParameter.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -213,7 +213,7 @@ public void testParameter() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/INTERFACE_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameParameter']]"
+ "@text='InputXpathAbbreviationAsWordInNameParameter']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]"
+ "/PARAMETERS/PARAMETER_DEF/IDENT[@text='PARAMETER']"
);
Expand All @@ -225,7 +225,7 @@ public void testParameter() throws Exception {
@Test
public void testVariable() throws Exception {
final File fileToProcess = new File(getPath(
"SuppressionXpathRegressionAbbreviationAsWordInNameVariable.java"));
"InputXpathAbbreviationAsWordInNameVariable.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbbreviationAsWordInNameCheck.class);
Expand All @@ -237,7 +237,7 @@ public void testVariable() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionAbbreviationAsWordInNameVariable']]"
+ "@text='InputXpathAbbreviationAsWordInNameVariable']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]"
+ "/SLIST/VARIABLE_DEF/IDENT[@text='VARIABLE']"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ protected String getCheckName() {
@Test
public void testClassNameTop() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionAbstractClassNameTop.java"));
new File(getPath("InputXpathAbstractClassNameTop.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbstractClassNameCheck.class);

final String[] expectedViolation = {
"3:1: " + getCheckMessage(AbstractClassNameCheck.class,
AbstractClassNameCheck.MSG_ILLEGAL_ABSTRACT_CLASS_NAME,
"SuppressionXpathRegressionAbstractClassNameTop", "^Abstract.+$"),
"InputXpathAbstractClassNameTop", "^Abstract.+$"),
};

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

Expand All @@ -69,7 +69,7 @@ public void testClassNameTop() throws Exception {
@Test
public void testClassNameInner() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionAbstractClassNameInner.java"));
new File(getPath("InputXpathAbstractClassNameInner.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbstractClassNameCheck.class);
Expand All @@ -82,13 +82,13 @@ public void testClassNameInner() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionAbstractClassNameInner']]"
+ "[./IDENT[@text='InputXpathAbstractClassNameInner']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='MyClass']]",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionAbstractClassNameInner']]"
+ "[./IDENT[@text='InputXpathAbstractClassNameInner']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='MyClass']]/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionAbstractClassNameInner']]"
+ "[./IDENT[@text='InputXpathAbstractClassNameInner']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='MyClass']]/MODIFIERS/ABSTRACT"
);

Expand All @@ -99,7 +99,7 @@ public void testClassNameInner() throws Exception {
@Test
public void testClassNameNoModifier() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionAbstractClassNameNoModifier.java"));
new File(getPath("InputXpathAbstractClassNameNoModifier.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(AbstractClassNameCheck.class);
Expand All @@ -112,13 +112,13 @@ public void testClassNameNoModifier() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='"
+ "SuppressionXpathRegressionAbstractClassNameNoModifier']]"
+ "InputXpathAbstractClassNameNoModifier']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='AbstractMyClass']]",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='"
+ "SuppressionXpathRegressionAbstractClassNameNoModifier']]"
+ "InputXpathAbstractClassNameNoModifier']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='AbstractMyClass']]/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='"
+ "SuppressionXpathRegressionAbstractClassNameNoModifier']]"
+ "InputXpathAbstractClassNameNoModifier']]"
+ "/OBJBLOCK/CLASS_DEF[./IDENT[@text='AbstractMyClass']]/LITERAL_CLASS"
);

Expand Down

0 comments on commit d35128b

Please sign in to comment.