Skip to content

test: migrate GenericsTest to JUnit 5 #4525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

MartinWitt
Copy link
Collaborator

#3919

Change Log

The following bad smells are refactored:

JUnit4-@test

The JUnit 4 @Test annotation should be replaced with JUnit 5 @Test annotation.

JUnit4Assertion

The JUnit4 assertion should be replaced with JUnit5 Assertions.

The following has changed in the code:

JUnit4-@test

  • Replaced junit 4 test annotation with junit 5 test annotation in testBugComparableComparator
  • Replaced junit 4 test annotation with junit 5 test annotation in testModelBuildingTree
  • Replaced junit 4 test annotation with junit 5 test annotation in testModelBuildingGenericConstructor
  • Replaced junit 4 test annotation with junit 5 test annotation in testDiamond2
  • Replaced junit 4 test annotation with junit 5 test annotation in testDiamond1
  • Replaced junit 4 test annotation with junit 5 test annotation in testModelBuildingSimilarSignatureMethods
  • Replaced junit 4 test annotation with junit 5 test annotation in testTypeParameterReference
  • Replaced junit 4 test annotation with junit 5 test annotation in testTypeParameterDeclarer
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericMethodCallWithExtend
  • Replaced junit 4 test annotation with junit 5 test annotation in testBugCommonCollection
  • Replaced junit 4 test annotation with junit 5 test annotation in testRecursiveUpperBound
  • Replaced junit 4 test annotation with junit 5 test annotation in testInstanceOfMapEntryGeneric
  • Replaced junit 4 test annotation with junit 5 test annotation in testAccessToGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testConstructorCallGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testInvocationGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testNewClassGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testMethodsWithGenericsWhoExtendsObject
  • Replaced junit 4 test annotation with junit 5 test annotation in testName
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericWithExtendsInDeclaration
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericInField
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericsInQualifiedNameInConstructorCall
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericsOnLocalType
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericsInConstructorCall
  • Replaced junit 4 test annotation with junit 5 test annotation in testWildcard
  • Replaced junit 4 test annotation with junit 5 test annotation in testGetDeclarationOnGenericReturnType
  • Replaced junit 4 test annotation with junit 5 test annotation in testDeclarationOfTypeParameterReference
  • Replaced junit 4 test annotation with junit 5 test annotation in testIsGenericsMethod
  • Replaced junit 4 test annotation with junit 5 test annotation in testTypeParameterReferenceAsActualTypeArgument
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericTypeReference
  • Replaced junit 4 test annotation with junit 5 test annotation in testisGeneric
  • Replaced junit 4 test annotation with junit 5 test annotation in testCtTypeReference_getSuperclass
  • Replaced junit 4 test annotation with junit 5 test annotation in testTypeAdapted
  • Replaced junit 4 test annotation with junit 5 test annotation in testClassTypingContext
  • Replaced junit 4 test annotation with junit 5 test annotation in testRecursiveTypeAdapting
  • Replaced junit 4 test annotation with junit 5 test annotation in testMethodTypingContext
  • Replaced junit 4 test annotation with junit 5 test annotation in testMethodTypingContextAdaptMethod
  • Replaced junit 4 test annotation with junit 5 test annotation in testClassTypingContextMethodSignature
  • Replaced junit 4 test annotation with junit 5 test annotation in testClassContextOnInnerClass
  • Replaced junit 4 test annotation with junit 5 test annotation in testWildCardonShadowClass
  • Replaced junit 4 test annotation with junit 5 test annotation in testDiamondComplexGenericsRxJava
  • Replaced junit 4 test annotation with junit 5 test annotation in testGetDeclarationOfTypeParameterReference
  • Replaced junit 4 test annotation with junit 5 test annotation in testIsSameSignatureWithGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testIsSameSignatureWithMethodGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testGetExecDeclarationOfEnumSetOf
  • Replaced junit 4 test annotation with junit 5 test annotation in testIsSameSignatureWithReferencedGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testIsGenericTypeEqual
  • Replaced junit 4 test annotation with junit 5 test annotation in testCannotAdaptTypeOfNonTypeScope
  • Replaced junit 4 test annotation with junit 5 test annotation in testGenericsOverriding
  • Replaced junit 4 test annotation with junit 5 test annotation in testDeepGenericsInExecutableReference
  • Replaced junit 4 test annotation with junit 5 test annotation in testTopLevelIsGenerics
  • Replaced junit 4 test annotation with junit 5 test annotation in testIsParameterized
  • Replaced junit 4 test annotation with junit 5 test annotation in testExecutableTypeParameter

JUnit4Assertion

  • Transformed junit4 assert to junit 5 assertion in testBugComparableComparator
  • Transformed junit4 assert to junit 5 assertion in testModelBuildingTree
  • Transformed junit4 assert to junit 5 assertion in testModelBuildingGenericConstructor
  • Transformed junit4 assert to junit 5 assertion in testDiamond2
  • Transformed junit4 assert to junit 5 assertion in testDiamond1
  • Transformed junit4 assert to junit 5 assertion in testModelBuildingSimilarSignatureMethods
  • Transformed junit4 assert to junit 5 assertion in testTypeParameterReference
  • Transformed junit4 assert to junit 5 assertion in testTypeParameterDeclarer
  • Transformed junit4 assert to junit 5 assertion in testGenericMethodCallWithExtend
  • Transformed junit4 assert to junit 5 assertion in testBugCommonCollection
  • Transformed junit4 assert to junit 5 assertion in testRecursiveUpperBound
  • Transformed junit4 assert to junit 5 assertion in testInstanceOfMapEntryGeneric
  • Transformed junit4 assert to junit 5 assertion in testAccessToGenerics
  • Transformed junit4 assert to junit 5 assertion in testConstructorCallGenerics
  • Transformed junit4 assert to junit 5 assertion in testInvocationGenerics
  • Transformed junit4 assert to junit 5 assertion in testNewClassGenerics
  • Transformed junit4 assert to junit 5 assertion in testMethodsWithGenericsWhoExtendsObject
  • Transformed junit4 assert to junit 5 assertion in testName
  • Transformed junit4 assert to junit 5 assertion in testGenericWithExtendsInDeclaration
  • Transformed junit4 assert to junit 5 assertion in testGenericInField
  • Transformed junit4 assert to junit 5 assertion in testGenericsInQualifiedNameInConstructorCall
  • Transformed junit4 assert to junit 5 assertion in testGenericsOnLocalType
  • Transformed junit4 assert to junit 5 assertion in testGenericsInConstructorCall
  • Transformed junit4 assert to junit 5 assertion in testWildcard
  • Transformed junit4 assert to junit 5 assertion in testGetDeclarationOnGenericReturnType
  • Transformed junit4 assert to junit 5 assertion in testDeclarationOfTypeParameterReference
  • Transformed junit4 assert to junit 5 assertion in testIsGenericsMethod
  • Transformed junit4 assert to junit 5 assertion in testTypeParameterReferenceAsActualTypeArgument
  • Transformed junit4 assert to junit 5 assertion in testGenericTypeReference
  • Transformed junit4 assert to junit 5 assertion in testisGeneric
  • Transformed junit4 assert to junit 5 assertion in testCtTypeReference_getSuperclass
  • Transformed junit4 assert to junit 5 assertion in testTypeAdapted
  • Transformed junit4 assert to junit 5 assertion in testClassTypingContext
  • Transformed junit4 assert to junit 5 assertion in testRecursiveTypeAdapting
  • Transformed junit4 assert to junit 5 assertion in testMethodTypingContext
  • Transformed junit4 assert to junit 5 assertion in testMethodTypingContextAdaptMethod
  • Transformed junit4 assert to junit 5 assertion in testClassTypingContextMethodSignature
  • Transformed junit4 assert to junit 5 assertion in testClassContextOnInnerClass
  • Transformed junit4 assert to junit 5 assertion in checkFakeTpl
  • Transformed junit4 assert to junit 5 assertion in testDiamondComplexGenericsRxJava
  • Transformed junit4 assert to junit 5 assertion in testGetDeclarationOfTypeParameterReference
  • Transformed junit4 assert to junit 5 assertion in testIsSameSignatureWithGenerics
  • Transformed junit4 assert to junit 5 assertion in testIsSameSignatureWithMethodGenerics
  • Transformed junit4 assert to junit 5 assertion in testGetExecDeclarationOfEnumSetOf
  • Transformed junit4 assert to junit 5 assertion in testIsSameSignatureWithReferencedGenerics
  • Transformed junit4 assert to junit 5 assertion in testIsGenericTypeEqual
  • Transformed junit4 assert to junit 5 assertion in testCannotAdaptTypeOfNonTypeScope
  • Transformed junit4 assert to junit 5 assertion in testGenericsOverriding
  • Transformed junit4 assert to junit 5 assertion in testDeepGenericsInExecutableReference
  • Transformed junit4 assert to junit 5 assertion in testTopLevelIsGenerics
  • Transformed junit4 assert to junit 5 assertion in testIsParameterized
  • Transformed junit4 assert to junit 5 assertion in testExecutableTypeParameter

 The following has changed in the code:
Replaced junit 4 test annotation with junit 5 test annotation in testBugComparableComparator
Replaced junit 4 test annotation with junit 5 test annotation in testModelBuildingTree
Replaced junit 4 test annotation with junit 5 test annotation in testModelBuildingGenericConstructor
Replaced junit 4 test annotation with junit 5 test annotation in testDiamond2
Replaced junit 4 test annotation with junit 5 test annotation in testDiamond1
Replaced junit 4 test annotation with junit 5 test annotation in testModelBuildingSimilarSignatureMethods
Replaced junit 4 test annotation with junit 5 test annotation in testTypeParameterReference
Replaced junit 4 test annotation with junit 5 test annotation in testTypeParameterDeclarer
Replaced junit 4 test annotation with junit 5 test annotation in testGenericMethodCallWithExtend
Replaced junit 4 test annotation with junit 5 test annotation in testBugCommonCollection
Replaced junit 4 test annotation with junit 5 test annotation in testRecursiveUpperBound
Replaced junit 4 test annotation with junit 5 test annotation in testInstanceOfMapEntryGeneric
Replaced junit 4 test annotation with junit 5 test annotation in testAccessToGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testConstructorCallGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testInvocationGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testNewClassGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testMethodsWithGenericsWhoExtendsObject
Replaced junit 4 test annotation with junit 5 test annotation in testName
Replaced junit 4 test annotation with junit 5 test annotation in testGenericWithExtendsInDeclaration
Replaced junit 4 test annotation with junit 5 test annotation in testGenericInField
Replaced junit 4 test annotation with junit 5 test annotation in testGenericsInQualifiedNameInConstructorCall
Replaced junit 4 test annotation with junit 5 test annotation in testGenericsOnLocalType
Replaced junit 4 test annotation with junit 5 test annotation in testGenericsInConstructorCall
Replaced junit 4 test annotation with junit 5 test annotation in testWildcard
Replaced junit 4 test annotation with junit 5 test annotation in testGetDeclarationOnGenericReturnType
Replaced junit 4 test annotation with junit 5 test annotation in testDeclarationOfTypeParameterReference
Replaced junit 4 test annotation with junit 5 test annotation in testIsGenericsMethod
Replaced junit 4 test annotation with junit 5 test annotation in testTypeParameterReferenceAsActualTypeArgument
Replaced junit 4 test annotation with junit 5 test annotation in testGenericTypeReference
Replaced junit 4 test annotation with junit 5 test annotation in testisGeneric
Replaced junit 4 test annotation with junit 5 test annotation in testCtTypeReference_getSuperclass
Replaced junit 4 test annotation with junit 5 test annotation in testTypeAdapted
Replaced junit 4 test annotation with junit 5 test annotation in testClassTypingContext
Replaced junit 4 test annotation with junit 5 test annotation in testRecursiveTypeAdapting
Replaced junit 4 test annotation with junit 5 test annotation in testMethodTypingContext
Replaced junit 4 test annotation with junit 5 test annotation in testMethodTypingContextAdaptMethod
Replaced junit 4 test annotation with junit 5 test annotation in testClassTypingContextMethodSignature
Replaced junit 4 test annotation with junit 5 test annotation in testClassContextOnInnerClass
Replaced junit 4 test annotation with junit 5 test annotation in testWildCardonShadowClass
Replaced junit 4 test annotation with junit 5 test annotation in testDiamondComplexGenericsRxJava
Replaced junit 4 test annotation with junit 5 test annotation in testGetDeclarationOfTypeParameterReference
Replaced junit 4 test annotation with junit 5 test annotation in testIsSameSignatureWithGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testIsSameSignatureWithMethodGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testGetExecDeclarationOfEnumSetOf
Replaced junit 4 test annotation with junit 5 test annotation in testIsSameSignatureWithReferencedGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testIsGenericTypeEqual
Replaced junit 4 test annotation with junit 5 test annotation in testCannotAdaptTypeOfNonTypeScope
Replaced junit 4 test annotation with junit 5 test annotation in testGenericsOverriding
Replaced junit 4 test annotation with junit 5 test annotation in testDeepGenericsInExecutableReference
Replaced junit 4 test annotation with junit 5 test annotation in testTopLevelIsGenerics
Replaced junit 4 test annotation with junit 5 test annotation in testIsParameterized
Replaced junit 4 test annotation with junit 5 test annotation in testExecutableTypeParameter
Transformed junit4 assert to junit 5 assertion in testBugComparableComparator
Transformed junit4 assert to junit 5 assertion in testModelBuildingTree
Transformed junit4 assert to junit 5 assertion in testModelBuildingGenericConstructor
Transformed junit4 assert to junit 5 assertion in testDiamond2
Transformed junit4 assert to junit 5 assertion in testDiamond1
Transformed junit4 assert to junit 5 assertion in testModelBuildingSimilarSignatureMethods
Transformed junit4 assert to junit 5 assertion in testTypeParameterReference
Transformed junit4 assert to junit 5 assertion in testTypeParameterDeclarer
Transformed junit4 assert to junit 5 assertion in testGenericMethodCallWithExtend
Transformed junit4 assert to junit 5 assertion in testBugCommonCollection
Transformed junit4 assert to junit 5 assertion in testRecursiveUpperBound
Transformed junit4 assert to junit 5 assertion in testInstanceOfMapEntryGeneric
Transformed junit4 assert to junit 5 assertion in testAccessToGenerics
Transformed junit4 assert to junit 5 assertion in testConstructorCallGenerics
Transformed junit4 assert to junit 5 assertion in testInvocationGenerics
Transformed junit4 assert to junit 5 assertion in testNewClassGenerics
Transformed junit4 assert to junit 5 assertion in testMethodsWithGenericsWhoExtendsObject
Transformed junit4 assert to junit 5 assertion in testName
Transformed junit4 assert to junit 5 assertion in testGenericWithExtendsInDeclaration
Transformed junit4 assert to junit 5 assertion in testGenericInField
Transformed junit4 assert to junit 5 assertion in testGenericsInQualifiedNameInConstructorCall
Transformed junit4 assert to junit 5 assertion in testGenericsOnLocalType
Transformed junit4 assert to junit 5 assertion in testGenericsInConstructorCall
Transformed junit4 assert to junit 5 assertion in testWildcard
Transformed junit4 assert to junit 5 assertion in testGetDeclarationOnGenericReturnType
Transformed junit4 assert to junit 5 assertion in testDeclarationOfTypeParameterReference
Transformed junit4 assert to junit 5 assertion in testIsGenericsMethod
Transformed junit4 assert to junit 5 assertion in testTypeParameterReferenceAsActualTypeArgument
Transformed junit4 assert to junit 5 assertion in testGenericTypeReference
Transformed junit4 assert to junit 5 assertion in testisGeneric
Transformed junit4 assert to junit 5 assertion in testCtTypeReference_getSuperclass
Transformed junit4 assert to junit 5 assertion in testTypeAdapted
Transformed junit4 assert to junit 5 assertion in testClassTypingContext
Transformed junit4 assert to junit 5 assertion in testRecursiveTypeAdapting
Transformed junit4 assert to junit 5 assertion in testMethodTypingContext
Transformed junit4 assert to junit 5 assertion in testMethodTypingContextAdaptMethod
Transformed junit4 assert to junit 5 assertion in testClassTypingContextMethodSignature
Transformed junit4 assert to junit 5 assertion in testClassContextOnInnerClass
Transformed junit4 assert to junit 5 assertion in checkFakeTpl
Transformed junit4 assert to junit 5 assertion in testDiamondComplexGenericsRxJava
Transformed junit4 assert to junit 5 assertion in testGetDeclarationOfTypeParameterReference
Transformed junit4 assert to junit 5 assertion in testIsSameSignatureWithGenerics
Transformed junit4 assert to junit 5 assertion in testIsSameSignatureWithMethodGenerics
Transformed junit4 assert to junit 5 assertion in testGetExecDeclarationOfEnumSetOf
Transformed junit4 assert to junit 5 assertion in testIsSameSignatureWithReferencedGenerics
Transformed junit4 assert to junit 5 assertion in testIsGenericTypeEqual
Transformed junit4 assert to junit 5 assertion in testCannotAdaptTypeOfNonTypeScope
Transformed junit4 assert to junit 5 assertion in testGenericsOverriding
Transformed junit4 assert to junit 5 assertion in testDeepGenericsInExecutableReference
Transformed junit4 assert to junit 5 assertion in testTopLevelIsGenerics
Transformed junit4 assert to junit 5 assertion in testIsParameterized
Transformed junit4 assert to junit 5 assertion in testExecutableTypeParameter
@@ -896,17 +898,17 @@ public void testCtTypeReference_getSuperclass() {
+ "spoon.test.generics.testclasses.Paella, "
+ "X"
+ ">",trWeddingLunch_Mole.getSuperclass().toString());
//future suggested behavior of CtTypeReference#getSuperclass() - the 3rd argument is Mole.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, here, sniper improves formatting.

@monperrus monperrus merged commit cac65af into INRIA:master Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants