Class ClassTester<T>

java.lang.Object
org.tudalgo.algoutils.reflect.ClassTester<T>

@Deprecated(since="0.7.0", forRemoval=true) public class ClassTester<T> extends Object
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

    Constructors
    Constructor
    Description
    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 Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds an interface matcher used for the test class.
    void
    addImplementsInterface(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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds an interface matcher used for the test class.
    void
    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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the class instance of the tested class is not null.
    static void
    assertClassNotNull(Class<?> theClass, String className)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the class instance is not null and fails with a proper message if it is null.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests that theClass is not null and fails with the predefined message if it cannot be resolved.
    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.
    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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether there are no interface extension.
    void
    assertEnumConstants(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.
    void
    assertFieldEquals(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.
    void
    assertFieldEquals(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.
    void
    assertHasGetter(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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the specified field has a Setter-Method.
    void
    assertHasSetter(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.
    void
    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.
    void
    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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the test class is an enum.
    static void
    assertIsEnum(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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the test class is an interface.
    static void
    assertIsInterface(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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the test class is a plain class.
    static void
    assertIsPlainClass(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.
    void
    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.
    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.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if theClass is not null.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the class instance of the tested class is not null.
    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.
    findClass(String packageName, String className, double 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> T
    findInstance(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.
    int
    Deprecated, 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.
    static List<Field>
    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 String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined class not found message.
    static Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the default value for the specified type.
    static String
    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 Object
    getFieldValue(Object instance, Field field)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the content of a 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 String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined interface not found message.
    org.mockito.MockingDetails
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the MockingDetails of theClass.
    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 Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a random value for the specified type.
    spoon.Launcher
    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.
    Class<? super T>
    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.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if theClass is mocked.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if theClass is a spy.
    static <T> T
    legacyFindInstance(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).
    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.
    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.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Resolves a constructor with the specified 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.
    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.
    void
    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.
    void
    setClassInstance(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 void
    setField(Object instance, Field field, Object value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the field to the specified value.
    void
    setField(Field field, Object value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a field value to the specified value.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a field value to a random value.
    static void
    setFieldTyped(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.
    void
    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.
    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.
    void
    setSuperClass(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.
    void
    setTheClass(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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 tested
      className - the name of the class that should be tested
      similarity - the maximum allowed name similarity to match
      accessModifier - the expected access modifier
      superClass - the expected super class
      implementsInterfaces - the matcher used for the interfaces that are expected to be implemented
      classInstance - 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 tested
      className - the name of the class that should be tested
      similarity - the maximum allowed name similarity to match
      accessModifier - the expected access modifier
      superClass - the expected super class
      implementsInterfaces - the matcher used for the interfaces that are expected to be implemented
    • ClassTester

      public 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.
      Parameters:
      packageName - the package name of the class to be tested
      className - the name of the class that should be tested
      similarity - the maximum allowed name similarity to match
      accessModifier - the expected access modifier
    • ClassTester

      public 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.
      Parameters:
      packageName - the package name of the class to be tested
      className - the name of the class that should be tested
      similarity - the maximum allowed name similarity to match
    • ClassTester

      public 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.
      Parameters:
      packageName - the package name of the class to be tested
      className - the name of the class that should be tested
    • ClassTester

      public ClassTester(Class<T> clazz)
      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

      public static List<Field> 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.
      Parameters:
      clazz - the class to look up for its fields
      Returns:
      the found fields of a class and its super classes
    • getAllFields

      public List<Field> 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

      public static String getClassNotFoundMessage(String className)
      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

      public String 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

      public static String getInterfaceNotImplementedMessage(String interfaceName)
      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

      public static void assertClassNotNull(Class<?> theClass, String className)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the class instance is not null and fails with a proper message if it is null.
      Parameters:
      theClass - the Class
      className - the Class Name for the error Message
    • getEnumConstantMissingMessage

      public static String getEnumConstantMissingMessage(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.
      Parameters:
      constantName - the enum constant used for the message
      Returns:
      a predefined message for a missing enum constant
    • getRandomEnumConstant

      public 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.
      Parameters:
      enumClass - the enum instance to retrieve its enum
      enumClassName - the name of the enumeration class
      Returns:
      the random enum constant
    • getRandomEnumConstant

      public Enum<?> 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

      public static Object getDefaultValue(Class<?> type)
      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

      public static Object getRandomValue(Class<?> type)
      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 instance
      className - the source class name
      derivedClassName - the name for the derived class
      Returns:
      the generated derived class
    • findInstance

      public static <T> T findInstance(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).
      Type Parameters:
      T - the type of the instance to resolve
      Parameters:
      clazz - the class to generate from the instance
      className - the class name
      Returns:
      the resolved instance
    • legacyFindInstance

      public static <T> T legacyFindInstance(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).
      Type Parameters:
      T - the type of the instance to resolve
      Parameters:
      clazz - the class to generate from the instance
      className - 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 content
      obj - the object instance containing the field
      value - the new value of the field
      Throws:
      IllegalAccessException - if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final; or if this Field object 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

      public static void setField(Object instance, Field field, Object value)
      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 field
      field - the field instance to change its content
      value - the new value of the field
    • setField

      public void setField(Field field, Object value)
      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 modify
      value - the new value of the field
    • getFieldValue

      public static Object getFieldValue(Object instance, Field field)
      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 field
      field - the field to retrieve its content
      Returns:
      the content of a field.
    • getFieldValue

      public Object getFieldValue(Field field)
      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

      public Object 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.
      Parameters:
      field - the field to modify
    • assertFieldEquals

      public void assertFieldEquals(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.
      Parameters:
      field - the field to check
      expected - the expected content of the field
      additionalMessage - the additional message if the test fails
    • assertFieldEquals

      public void assertFieldEquals(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.
      Parameters:
      field - the field to check
      expected - the expected content
    • getImplementsInterfaces

      public List<IdentifierMatcher> 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

      public void setImplementsInterfaces(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.
      Parameters:
      implementsInterfaces - the new implemented class of the test class
    • getSuperClass

      public Class<? super T> 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

      public void setSuperClass(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.
      Parameters:
      superClass - the new super class of the test class
    • addImplementsInterface

      public void addImplementsInterface(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.
      Parameters:
      interfaceMatcher - the interface matcher to add
    • addImplementsInterface

      public void addImplementsInterface(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.
      Parameters:
      interfaceName - the name interface matcher to add
      similarity - the maximum allowed similarity
    • addImplementsInterface

      public void addImplementsInterface(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.
      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

      public ClassTester<T> 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

      public Field 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.
      Parameters:
      matcher - the matcher used to resolve the attribute (field)
      Returns:
      the resolved field
    • assertHasGetter

      public void assertHasGetter(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.
      Parameters:
      attribute - the field to check
      parameters - the parameter matcher to match the field
    • assertHasSetter

      public void assertHasSetter(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.
      Parameters:
      attribute - the field to check
      testValue - the test value to test the Setter-Method
    • assertHasSetter

      public void assertHasSetter(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.
      Parameters:
      attribute - the field to check
    • assertImplementsInterfaces

      public void assertImplementsInterfaces(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.
      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.
      Returns true if theClass is not null.
      Returns:
      true if theClass is not null
    • getMockingDetails

      public org.mockito.MockingDetails getMockingDetails()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the MockingDetails of theClass.
      Returns:
      the MockingDetails of theClass
    • is_mock

      public boolean is_mock()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if theClass is mocked.
      Returns:
      true if theClass is 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.
      Returns true if theClass is a spy.
      Returns:
      true if theClass is a spy
      See Also:
      • MockingDetails.isSpy()
    • assureSpied

      public ClassTester<T> 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

      public ClassTester<T> 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 that theClass is not null and fails with the predefined message if it cannot be resolved.
    • verify

      public ClassTester<T> 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

      public ClassTester<T> verify(double minSimilarity)
      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

      public Class<T> 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

      public void setTheClass(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.
      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

      public T 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

      public void setClassInstance(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.
      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.
      Returns true if the class instance of the tested class is not null.
      Returns:
      true if the class instance of the tested class is not null
    • 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 not null.
    • assertEnumConstants

      public void assertEnumConstants(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.
      Parameters:
      expectedConstants - the name of the enum constants to check
    • getClassIdentifier

      public IdentifierMatcher 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

      public void setClassIdentifier(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.
      Parameters:
      classIdentifier - the new the class matcher used on the test class
    • findClass

      public Class<T> findClass(String packageName, String className, double similarity)
      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 class
      className - the name of the class to resolve
      similarity - The minimum required similarity
      Returns:
      the resolved Class With the given name and similarity
    • findClass

      public Class<T> 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

      public Class<T> findClass(double similarity)
      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

      public ClassTester<T> 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

      public ClassTester<T> 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

      public ClassTester<T> 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

      public ClassTester<T> 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

      public T 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

      public T 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

      public T 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

      public ClassTester<T> 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

      public Constructor<T> 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.
      Parameters:
      parameters - the parameters of the constructor
      Returns:
      the best matched constructor
    • resolveConstructor

      public Constructor<T> resolveConstructor(ParameterMatcher... parameters)
      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 check
      accessModifier - the expected access modifier count
      parameters - 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 check
      accessModifier - the expected access modifier count
      parameters - 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 class
      expectedName - the name of the enum class
      similarity - the min similarity of the name
      Returns:
      the specified enum value
    • getEnumValue

      public 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.
      Parameters:
      expectedName - the enum class name to retrieve the value.
      similarity - the min similarity
      Returns:
      the specific enum value
    • assertIsInterface

      public static void assertIsInterface(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.
      Parameters:
      theClass - the class instance to check
      className - 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

      public static void assertIsEnum(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.
      Parameters:
      theClass - the class instance to check
      className - 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

      public static void assertIsPlainClass(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.
      Parameters:
      theClass - the class instance to check
      className - the name of the class