Package org.tudalgo.algoutils.reflect
Class ClassTester<T>
java.lang.Object
org.tudalgo.algoutils.reflect.ClassTester<T>
Deprecated, for removal: This API element is subject to removal in a future version.
A class tester which tests properties of a class.
This class is deprecated and will be removed in a future release.
Use the new API located in the
org.tudalgo.algoutils.tutor.general.reflections package instead.-
Constructor Summary
ConstructorsConstructorDescriptionClassTester(Class<T> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.ClassTester(String packageName, String className) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.ClassTester(String packageName, String className, double similarity) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.ClassTester(String packageName, String className, double similarity, int accessModifier) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.ClassTester(String packageName, String className, double similarity, int accessModifier, Class<? super T> superClass, ArrayList<IdentifierMatcher> implementsInterfaces) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.ClassTester(String packageName, String className, double similarity, int accessModifier, Class<? super T> superClass, List<IdentifierMatcher> implementsInterfaces, T classInstance) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImplementsInterface(String interfaceName) Deprecated, for removal: This API element is subject to removal in a future version.Adds an interface matcher used for the test class.voidaddImplementsInterface(String interfaceName, double similarity) Deprecated, for removal: This API element is subject to removal in a future version.Adds an interface matcher used for the test class.voidaddImplementsInterface(IdentifierMatcher interfaceMatcher) Deprecated, for removal: This API element is subject to removal in a future version.Adds an interface matcher used for the test class.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether the access modifier count is correct and fails it with a predefined message if it fails.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance of the tested class is notnull.static voidassertClassNotNull(Class<?> theClass, String className) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is notnulland fails with a proper message if it isnull.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests thattheClassis notnulland fails with the predefined message if it cannot be resolved.voidassertConstructorValid(Constructor<T> constructor, int accessModifier, ArrayList<ParameterMatcher> parameters) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether a constructor was declared correctly.voidassertConstructorValid(Constructor<T> constructor, int accessModifier, ParameterMatcher... parameters) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether a constructor was declared correctly.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether there are no interface extension.voidassertEnumConstants(String[] expectedConstants) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the enum constants with the specified names exists.voidassertFieldEquals(Field field, Object expected) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether a field has a certain content.voidassertFieldEquals(Field field, Object expected, String additionalMessage) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a specified content.voidassertHasGetter(Field attribute, ParameterMatcher... parameters) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a Getter-Method.voidassertHasSetter(Field attribute) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a Setter-Method.voidassertHasSetter(Field attribute, Object testValue) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a Setter-Method.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether all described interfaces by the specified matchers are being extended.voidassertImplementsInterfaces(List<IdentifierMatcher> implementsInterfaces) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether all described interfaces by the specified matchers are being extended.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether the test class is an enum.static voidassertIsEnum(Class<?> theClass, String className) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is an enum.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether the test class is an interface.static voidassertIsInterface(Class<?> theClass, String className) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is an interface.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether the test class is a plain class.static voidassertIsPlainClass(Class<?> theClass, String className) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is a plain class.Deprecated, for removal: This API element is subject to removal in a future version.Tests whether this class is a spy.voidDeprecated, for removal: This API element is subject to removal in a future version.Tests whether the super classes fo the test classes matches the specified super classes.Deprecated, for removal: This API element is subject to removal in a future version.Resolves the class if necessary.Deprecated, for removal: This API element is subject to removal in a future version.Makes the class a spy if not done already.Deprecated, for removal: This API element is subject to removal in a future version.Returns instance of a class tester with the needed configuration for spoon.booleanDeprecated, for removal: This API element is subject to removal in a future version.ReturnstrueiftheClassis not null.booleanDeprecated, for removal: This API element is subject to removal in a future version.Returnstrueif the class instance of the tested class is notnull.Deprecated, for removal: This API element is subject to removal in a future version.Resolves a class with the current class name and similarity.findClass(double similarity) Deprecated, for removal: This API element is subject to removal in a future version.Resolves a class with the specified similarity.Deprecated, for removal: This API element is subject to removal in a future version.Resolves a class with the specified name and similarity.static <T> TfindInstance(Class<? super T> clazz, String className) Deprecated, for removal: This API element is subject to removal in a future version.Resolves an instance of a given class (even abstract).static <T> Class<? extends T>generateDerivedClass(Class<T> clazz, String className, String derivedClassName) Deprecated, for removal: This API element is subject to removal in a future version.Generates a derived class from a specified class.intDeprecated, for removal: This API element is subject to removal in a future version.Returns the expected access modifier.Deprecated, for removal: This API element is subject to removal in a future version.Returns all fields of the test class and its super classes.getAllFields(Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Returns all fields of a class and its super classes recursively.Deprecated, for removal: This API element is subject to removal in a future version.Returns the class matcher used on the test class.Deprecated, for removal: This API element is subject to removal in a future version.Returns class instance of the tested class.Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined class not found message.static StringgetClassNotFoundMessage(String className) Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined class not found message.static ObjectgetDefaultValue(Class<?> type) Deprecated, for removal: This API element is subject to removal in a future version.Returns the default value for the specified type.static StringgetEnumConstantMissingMessage(String constantName) Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined message for a missing enum constant.static <T> Enum<?>getEnumValue(Class<Enum<?>> enumClass, String expectedName, double similarity) Deprecated, for removal: This API element is subject to removal in a future version.Returns the specified enum value.Enum<?>getEnumValue(String expectedName, double similarity) Deprecated, for removal: This API element is subject to removal in a future version.Returns a specific enum value.static ObjectgetFieldValue(Object instance, Field field) Deprecated, for removal: This API element is subject to removal in a future version.Returns the content of a field.getFieldValue(Field field) Deprecated, for removal: This API element is subject to removal in a future version.Returns the field content.Deprecated, for removal: This API element is subject to removal in a future version.Returns the implemented interfaces of the tested class.static StringgetInterfaceNotImplementedMessage(String interfaceName) Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined interface not found message.org.mockito.MockingDetailsDeprecated, for removal: This API element is subject to removal in a future version.Returns theMockingDetailsoftheClass.Deprecated, for removal: This API element is subject to removal in a future version.Returns a new test class instance.Deprecated, for removal: This API element is subject to removal in a future version.Returns a new test class instance.Enum<?>Deprecated, for removal: This API element is subject to removal in a future version.Returns a random enum constant.static Enum<?>getRandomEnumConstant(Class<Enum<?>> enumClass, String enumClassName) Deprecated, for removal: This API element is subject to removal in a future version.Returns a random enum constant from the available enum constants.static ObjectgetRandomValue(Class<?> type) Deprecated, for removal: This API element is subject to removal in a future version.Returns a random value for the specified type.spoon.LaunchergetSpoon()Deprecated, for removal: This API element is subject to removal in a future version.Returns the spoon launcher which allows source code analysis and transformation.Deprecated, for removal: This API element is subject to removal in a future version.Returns the super class of the tested class.Deprecated, for removal: This API element is subject to removal in a future version.Returns the test classes if it is already resolved.booleanis_mock()Deprecated, for removal: This API element is subject to removal in a future version.ReturnstrueiftheClassis mocked.booleanis_spy()Deprecated, for removal: This API element is subject to removal in a future version.ReturnstrueiftheClassis a spy.static <T> TlegacyFindInstance(Class<? super T> clazz, String className) Deprecated, for removal: This API element is subject to removal in a future version.Resolves an instance of a given class (even abstract).resolve()Deprecated, for removal: This API element is subject to removal in a future version.Resolves the class and instance and stores them.resolveAttribute(AttributeMatcher matcher) Deprecated, for removal: This API element is subject to removal in a future version.Resolves a field (attribute) with a specified matcher.Deprecated, for removal: This API element is subject to removal in a future version.Finds the class to test and stores it.resolveConstructor(List<ParameterMatcher> parameters) Deprecated, for removal: This API element is subject to removal in a future version.Resolves a constructor with the specified parameters.resolveConstructor(ParameterMatcher... parameters) Deprecated, for removal: This API element is subject to removal in a future version.Resolves a constructor with the parameters.Deprecated, for removal: This API element is subject to removal in a future version.Resolves a test class instance.Deprecated, for removal: This API element is subject to removal in a future version.Resolves the class and instance and stores them.Deprecated, for removal: This API element is subject to removal in a future version.Resolve a real test class instance.voidsetAccessModifier(int accessModifier) Deprecated, for removal: This API element is subject to removal in a future version.Sets the expected access modifier the specified value.voidsetClassIdentifier(IdentifierMatcher classIdentifier) Deprecated, for removal: This API element is subject to removal in a future version.Sets the class matcher used on the test class to the new value.voidsetClassInstance(T classInstance) Deprecated, for removal: This API element is subject to removal in a future version.Sets class instance of the tested class to the specified value.static voidDeprecated, for removal: This API element is subject to removal in a future version.Sets the field to the specified value.voidDeprecated, for removal: This API element is subject to removal in a future version.Sets a field value to the specified value.setFieldRandom(Field field) Deprecated, for removal: This API element is subject to removal in a future version.Sets a field value to a random value.static voidsetFieldTyped(Field field, Object obj, Object value) Deprecated, for removal: This API element is subject to removal in a future version.Sets the typed field to the specified value.voidsetImplementsInterfaces(List<IdentifierMatcher> implementsInterfaces) Deprecated, for removal: This API element is subject to removal in a future version.Sets the implemented class of the tested class to the specified value.voidsetSpoon(spoon.Launcher spoon) Deprecated, for removal: This API element is subject to removal in a future version.Sets the spoon launcher which allows source code analysis and transformation to the specified value.voidsetSuperClass(Class<? super T> superClass) Deprecated, for removal: This API element is subject to removal in a future version.Sets the super class of the tested class to the specified value.voidsetTheClass(Class<T> theClass) Deprecated, for removal: This API element is subject to removal in a future version.Sets the test class instance to the specified class instance.verify()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the Class is declared correctly.verify(double minSimilarity) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the Class is declared correctly.
-
Constructor Details
-
ClassTester
public ClassTester(String packageName, String className, double similarity, int accessModifier, Class<? super T> superClass, List<IdentifierMatcher> implementsInterfaces, T classInstance) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.- Parameters:
packageName- the package name of the class to be testedclassName- the name of the class that should be testedsimilarity- the maximum allowed name similarity to matchaccessModifier- the expected access modifiersuperClass- the expected super classimplementsInterfaces- the matcher used for the interfaces that are expected to be implementedclassInstance- the class instance of the tested class
-
ClassTester
public ClassTester(String packageName, String className, double similarity, int accessModifier, Class<? super T> superClass, ArrayList<IdentifierMatcher> implementsInterfaces) Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.- Parameters:
packageName- the package name of the class to be testedclassName- the name of the class that should be testedsimilarity- the maximum allowed name similarity to matchaccessModifier- the expected access modifiersuperClass- the expected super classimplementsInterfaces- the matcher used for the interfaces that are expected to be implemented
-
ClassTester
Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.- Parameters:
packageName- the package name of the class to be testedclassName- the name of the class that should be testedsimilarity- the maximum allowed name similarity to matchaccessModifier- the expected access modifier
-
ClassTester
Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.- Parameters:
packageName- the package name of the class to be testedclassName- the name of the class that should be testedsimilarity- the maximum allowed name similarity to match
-
ClassTester
Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.- Parameters:
packageName- the package name of the class to be testedclassName- the name of the class that should be tested
-
ClassTester
Deprecated, for removal: This API element is subject to removal in a future version.Constructs and initializes a class tester.- Parameters:
clazz- the class to be tested
-
-
Method Details
-
getAllFields
Deprecated, for removal: This API element is subject to removal in a future version.Returns all fields of a class and its super classes recursively.- Parameters:
clazz- the class to look up for its fields- Returns:
- the found fields of a class and its super classes
-
getAllFields
Deprecated, for removal: This API element is subject to removal in a future version.Returns all fields of the test class and its super classes.- Returns:
- all fields of the test class and its super classes
-
getClassNotFoundMessage
Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined class not found message.- Parameters:
className- the class name used for the message- Returns:
- a predefined class not found message
-
getClassNotFoundMessage
Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined class not found message.- Returns:
- a predefined class not found message
-
getInterfaceNotImplementedMessage
Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined interface not found message.- Parameters:
interfaceName- the name of the interface used for the message- Returns:
- a predefined interface not found message
-
assertClassNotNull
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is notnulland fails with a proper message if it isnull.- Parameters:
theClass- theClassclassName- the Class Name for the error Message
-
getEnumConstantMissingMessage
Deprecated, for removal: This API element is subject to removal in a future version.Generates a predefined message for a missing enum constant.- Parameters:
constantName- the enum constant used for the message- Returns:
- a predefined message for a missing enum constant
-
getRandomEnumConstant
Deprecated, for removal: This API element is subject to removal in a future version.Returns a random enum constant from the available enum constants.- Parameters:
enumClass- the enum instance to retrieve its enumenumClassName- the name of the enumeration class- Returns:
- the random enum constant
-
getRandomEnumConstant
Deprecated, for removal: This API element is subject to removal in a future version.Returns a random enum constant.- Returns:
- a random enum constant
-
getDefaultValue
Deprecated, for removal: This API element is subject to removal in a future version.Returns the default value for the specified type.- Parameters:
type- the class type of the default type- Returns:
- the default value for the specified type
-
getRandomValue
Deprecated, for removal: This API element is subject to removal in a future version.Returns a random value for the specified type.- Parameters:
type- the type to generate a random value- Returns:
- a random value for the specified type
-
generateDerivedClass
public static <T> Class<? extends T> generateDerivedClass(Class<T> clazz, String className, String derivedClassName) Deprecated, for removal: This API element is subject to removal in a future version.Generates a derived class from a specified class.- Type Parameters:
T- the type of the class- Parameters:
clazz- the source class instanceclassName- the source class namederivedClassName- the name for the derived class- Returns:
- the generated derived class
-
findInstance
Deprecated, for removal: This API element is subject to removal in a future version.Resolves an instance of a given class (even abstract).- Type Parameters:
T- the type of the instance to resolve- Parameters:
clazz- the class to generate from the instanceclassName- the class name- Returns:
- the resolved instance
-
legacyFindInstance
Deprecated, for removal: This API element is subject to removal in a future version.Resolves an instance of a given class (even abstract).- Type Parameters:
T- the type of the instance to resolve- Parameters:
clazz- the class to generate from the instanceclassName- the class name- Returns:
- the resolved instance
-
setFieldTyped
public static void setFieldTyped(Field field, Object obj, Object value) throws IllegalArgumentException, IllegalAccessException Deprecated, for removal: This API element is subject to removal in a future version.Sets the typed field to the specified value.- Parameters:
field- the field instance to change its contentobj- the object instance containing the fieldvalue- the new value of the field- Throws:
IllegalAccessException- if thisFieldobject is enforcing Java language access control and the underlying field is either inaccessible or final; or if thisFieldobject has no write access.IllegalArgumentException- if the specified object is not an instance of the class or interface declaring the underlying field (or a subclass or implementor thereof), or if an unwrapping conversion fails.
-
setField
Deprecated, for removal: This API element is subject to removal in a future version.Sets the field to the specified value.- Parameters:
instance- the object instance containing the fieldfield- the field instance to change its contentvalue- the new value of the field
-
setField
Deprecated, for removal: This API element is subject to removal in a future version.Sets a field value to the specified value.- Parameters:
field- the field to modifyvalue- the new value of the field
-
getFieldValue
Deprecated, for removal: This API element is subject to removal in a future version.Returns the content of a field.- Parameters:
instance- the object instance containing the fieldfield- the field to retrieve its content- Returns:
- the content of a field.
-
getFieldValue
Deprecated, for removal: This API element is subject to removal in a future version.Returns the field content.- Parameters:
field- the field to access- Returns:
- the field content
-
setFieldRandom
Deprecated, for removal: This API element is subject to removal in a future version.Sets a field value to a random value.- Parameters:
field- the field to modify
-
assertFieldEquals
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a specified content.- Parameters:
field- the field to checkexpected- the expected content of the fieldadditionalMessage- the additional message if the test fails
-
assertFieldEquals
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether a field has a certain content.- Parameters:
field- the field to checkexpected- the expected content
-
getImplementsInterfaces
Deprecated, for removal: This API element is subject to removal in a future version.Returns the implemented interfaces of the tested class.- Returns:
- the implemented interfaces of the tested class
-
setImplementsInterfaces
Deprecated, for removal: This API element is subject to removal in a future version.Sets the implemented class of the tested class to the specified value.- Parameters:
implementsInterfaces- the new implemented class of the test class
-
getSuperClass
Deprecated, for removal: This API element is subject to removal in a future version.Returns the super class of the tested class.- Returns:
- the super class of the tested class
-
setSuperClass
Deprecated, for removal: This API element is subject to removal in a future version.Sets the super class of the tested class to the specified value.- Parameters:
superClass- the new super class of the test class
-
addImplementsInterface
Deprecated, for removal: This API element is subject to removal in a future version.Adds an interface matcher used for the test class.- Parameters:
interfaceMatcher- the interface matcher to add
-
addImplementsInterface
Deprecated, for removal: This API element is subject to removal in a future version.Adds an interface matcher used for the test class.- Parameters:
interfaceName- the name interface matcher to addsimilarity- the maximum allowed similarity
-
addImplementsInterface
Deprecated, for removal: This API element is subject to removal in a future version.Adds an interface matcher used for the test class.- Parameters:
interfaceName- the name interface matcher to add
-
getSpoon
public spoon.Launcher getSpoon()Deprecated, for removal: This API element is subject to removal in a future version.Returns the spoon launcher which allows source code analysis and transformation.- Returns:
- the spoon launcher which allows source code analysis and transformation
-
setSpoon
public void setSpoon(spoon.Launcher spoon) Deprecated, for removal: This API element is subject to removal in a future version.Sets the spoon launcher which allows source code analysis and transformation to the specified value.- Parameters:
spoon- the new spoon launcher
-
assureSpoonLauncherModelsBuild
Deprecated, for removal: This API element is subject to removal in a future version.Returns instance of a class tester with the needed configuration for spoon.- Returns:
- instance of a class tester with the needed configuration for spoon
-
resolveAttribute
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a field (attribute) with a specified matcher.- Parameters:
matcher- the matcher used to resolve the attribute (field)- Returns:
- the resolved field
-
assertHasGetter
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a Getter-Method.- Parameters:
attribute- the field to checkparameters- the parameter matcher to match the field
-
assertHasSetter
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a Setter-Method.- Parameters:
attribute- the field to checktestValue- the test value to test the Setter-Method
-
assertHasSetter
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the specified field has a Setter-Method.- Parameters:
attribute- the field to check
-
assertImplementsInterfaces
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether all described interfaces by the specified matchers are being extended.- Parameters:
implementsInterfaces- the matchers to match the criterion of extension
-
assertImplementsInterfaces
public void assertImplementsInterfaces()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether all described interfaces by the specified matchers are being extended. -
assertDoesNotImplementAnyInterfaces
public void assertDoesNotImplementAnyInterfaces()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether there are no interface extension. -
class_resolved
public boolean class_resolved()Deprecated, for removal: This API element is subject to removal in a future version.ReturnstrueiftheClassis not null.- Returns:
trueiftheClassis not null
-
getMockingDetails
public org.mockito.MockingDetails getMockingDetails()Deprecated, for removal: This API element is subject to removal in a future version.Returns theMockingDetailsoftheClass.- Returns:
- the
MockingDetailsoftheClass
-
is_mock
public boolean is_mock()Deprecated, for removal: This API element is subject to removal in a future version.ReturnstrueiftheClassis mocked.- Returns:
trueiftheClassis mocked- See Also:
-
MockingDetails.isMock()
-
is_spy
public boolean is_spy()Deprecated, for removal: This API element is subject to removal in a future version.ReturnstrueiftheClassis a spy.- Returns:
trueiftheClassis a spy- See Also:
-
MockingDetails.isSpy()
-
assureSpied
Deprecated, for removal: This API element is subject to removal in a future version.Makes the class a spy if not done already.- Returns:
- this class tester
-
assertSpied
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether this class is a spy.- Returns:
- this class tester
-
assertClassResolved
public void assertClassResolved()Deprecated, for removal: This API element is subject to removal in a future version.Tests thattheClassis notnulland fails with the predefined message if it cannot be resolved. -
verify
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the Class is declared correctly.- Returns:
- this class tester
-
verify
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the Class is declared correctly.- Parameters:
minSimilarity- the minimum required similarity- Returns:
- this class tester
-
assertSuperclass
public void assertSuperclass()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the super classes fo the test classes matches the specified super classes. -
getTheClass
Deprecated, for removal: This API element is subject to removal in a future version.Returns the test classes if it is already resolved.- Returns:
- the test classes if it is already resolved
-
setTheClass
Deprecated, for removal: This API element is subject to removal in a future version.Sets the test class instance to the specified class instance.- Parameters:
theClass- the new test class instance
-
getAccessModifier
public int getAccessModifier()Deprecated, for removal: This API element is subject to removal in a future version.Returns the expected access modifier.- Returns:
- the expected access modifier
-
setAccessModifier
public void setAccessModifier(int accessModifier) Deprecated, for removal: This API element is subject to removal in a future version.Sets the expected access modifier the specified value.- Parameters:
accessModifier- the new expected access modifier count
-
assertAccessModifier
public void assertAccessModifier()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the access modifier count is correct and fails it with a predefined message if it fails. -
getClassInstance
Deprecated, for removal: This API element is subject to removal in a future version.Returns class instance of the tested class.- Returns:
- class instance of the tested class
-
setClassInstance
Deprecated, for removal: This API element is subject to removal in a future version.Sets class instance of the tested class to the specified value.- Parameters:
classInstance- the new value of the class instance of the tested class
-
classInstanceResolved
public boolean classInstanceResolved()Deprecated, for removal: This API element is subject to removal in a future version.Returnstrueif the class instance of the tested class is notnull.- Returns:
trueif the class instance of the tested class is notnull
-
assertclassInstanceResolved
public void assertclassInstanceResolved()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance of the tested class is notnull. -
assertEnumConstants
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the enum constants with the specified names exists.- Parameters:
expectedConstants- the name of the enum constants to check
-
getClassIdentifier
Deprecated, for removal: This API element is subject to removal in a future version.Returns the class matcher used on the test class.- Returns:
- the class matcher used on the test class
-
setClassIdentifier
Deprecated, for removal: This API element is subject to removal in a future version.Sets the class matcher used on the test class to the new value.- Parameters:
classIdentifier- the new the class matcher used on the test class
-
findClass
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a class with the specified name and similarity.- Parameters:
packageName- the package name of the classclassName- the name of the class to resolvesimilarity- The minimum required similarity- Returns:
- the resolved Class With the given name and similarity
-
findClass
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a class with the current class name and similarity.- Returns:
- the resolved class with the current class name and similarity.
-
findClass
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a class with the specified similarity.- Parameters:
similarity- the minimum required similarity- Returns:
- the resolved class with the specified similarity
-
resolveClass
Deprecated, for removal: This API element is subject to removal in a future version.Finds the class to test and stores it.- Returns:
- this class tester
-
assureClassResolved
Deprecated, for removal: This API element is subject to removal in a future version.Resolves the class if necessary. (We do not care about fields being made accessible here)- Returns:
- this class tester
-
resolve
Deprecated, for removal: This API element is subject to removal in a future version.Resolves the class and instance and stores them.- Returns:
- this class tester
-
resolveReal
Deprecated, for removal: This API element is subject to removal in a future version.Resolves the class and instance and stores them.- Returns:
- this class tester
-
resolveInstance
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a test class instance. (even abstract)- Returns:
- the test class instance
-
getNewInstance
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new test class instance.- Returns:
- the new test class instance
-
getNewRealInstance
Deprecated, for removal: This API element is subject to removal in a future version.Returns a new test class instance.- Returns:
- the new test class instance
-
resolveRealInstance
Deprecated, for removal: This API element is subject to removal in a future version.Resolve a real test class instance.- Returns:
- this class tester
-
resolveConstructor
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a constructor with the specified parameters.- Parameters:
parameters- the parameters of the constructor- Returns:
- the best matched constructor
-
resolveConstructor
Deprecated, for removal: This API element is subject to removal in a future version.Resolves a constructor with the parameters.- Parameters:
parameters- the parameters of the constructor- Returns:
- the best matched constructor
-
assertConstructorValid
public void assertConstructorValid(Constructor<T> constructor, int accessModifier, ArrayList<ParameterMatcher> parameters) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether a constructor was declared correctly.- Parameters:
constructor- the constructor to checkaccessModifier- the expected access modifier countparameters- the expected parameters of the constructor
-
assertConstructorValid
public void assertConstructorValid(Constructor<T> constructor, int accessModifier, ParameterMatcher... parameters) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether a constructor was declared correctly.- Parameters:
constructor- the constructor to checkaccessModifier- the expected access modifier countparameters- the expected parameters of the constructor
-
getEnumValue
public static <T> Enum<?> getEnumValue(Class<Enum<?>> enumClass, String expectedName, double similarity) Deprecated, for removal: This API element is subject to removal in a future version.Returns the specified enum value.- Type Parameters:
T- the type of the enum class- Parameters:
enumClass- the enum classexpectedName- the name of the enum classsimilarity- the min similarity of the name- Returns:
- the specified enum value
-
getEnumValue
Deprecated, for removal: This API element is subject to removal in a future version.Returns a specific enum value.- Parameters:
expectedName- the enum class name to retrieve the value.similarity- the min similarity- Returns:
- the specific enum value
-
assertIsInterface
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is an interface.- Parameters:
theClass- the class instance to checkclassName- the name of the class
-
assertIsInterface
public void assertIsInterface()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the test class is an interface. -
assertIsEnum
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is an enum.- Parameters:
theClass- the class instance to checkclassName- the name of the class
-
assertIsEnum
public void assertIsEnum()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the test class is an enum. -
assertIsPlainClass
public void assertIsPlainClass()Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the test class is a plain class. -
assertIsPlainClass
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the class instance is a plain class.- Parameters:
theClass- the class instance to checkclassName- the name of the class
-