Class MethodTester

java.lang.Object
org.tudalgo.algoutils.reflect.MethodTester

@Deprecated(since="0.7.0", forRemoval=true) public class MethodTester extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
A method 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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Indicator if super class check are allowed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MethodTester(ClassTester<?> classTester, String methodName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType, ArrayList<ParameterMatcher> parameters, boolean allowSuperClass, boolean looseReturnTypeChecking)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType, List<ParameterMatcher> parameters)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType, List<ParameterMatcher> parameters, boolean allowSuperClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method tester.
    MethodTester(ClassTester<?> classTester, String methodName, double similarity, Class<?> returnType, ArrayList<ParameterMatcher> parameters)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs and initializes a method 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 expected parameter matchers to this tester.
    void
    addParameter(Class<?> type, String name, double similarity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds an expected parameters' matcher to this tester.
    void
    addParameter(ParameterMatcher... parameterMatchers)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds an expected parameters' matcher to this tester.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the actual access modifier count matches with the expected one.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the class tester used to invoke the method can be resolved.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the class tester used to invoke the method is not null.
    void
    assertConstructsNotUsed(List<Class<? extends spoon.reflect.code.CtCodeElement>> disallowedConstructs)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether none of the blacklisted constructs where used in the constructor.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the method can be invoked.
    static void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the specified method is not null.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the test method could be resolved.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the method parameters matches with the expected parameters.
    static void
    assertParametersMatch(Method m, String methodName, List<ParameterMatcher> parameters, boolean ignoreNames)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the method parameters match.
    static void
    assertParametersMatch(List<ParameterMatcher> expectedParameters, List<Parameter> actualParameters, boolean ignoreNames)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the method parameters match.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the actual return type matches the expected return type.
    void
    assertReturnValueEquals(Object expected, Object... params)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the return value after the invocation with the specified parameters are correct.
    void
    assertReturnValueEquals(Object expected, String additionalMessage, Object... params)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests whether the return value after the invocation with the specified parameters are correct.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Assures that the method has been resolved.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the class tester used to invoke the method is not null and can be resolved.
    static int
    countMatchingParameters(Method m, String methodName, List<ParameterMatcher> parameters, boolean ignoreNames)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Counts the matching parameters.
    static int
    countMatchingParameters(List<ParameterMatcher> expectedParameters, List<Parameter> actualParameters, boolean ignoreNames)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Counts the matching parameters.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the expected access modifier count.
    static List<Method>
    getAllMethods(Class<?> clazz)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns all fields from a class and its super classes recursively.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the class tester used to invoke the method.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined class tester null message.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined message for an invalid return type.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the number of invocations.
    List<org.mockito.invocation.Invocation>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the invocations of the test method.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the method identifier containing the name of the method and the similarity to accept alternative identifiers.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined method not found message.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined method not found message.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the expected parameters.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the random valid parameter values.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the expected class type of the test method.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Generates a predefined should not have parameter message.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the method that should be tested.
    invoke(Object... params)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Invokes test method using the class tester.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if the method can be invoked, more formally returns true if the class tester used to invoke the method, the method itself can be resolved.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Invokes the test method with random parameters.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if subtype are allowed for the return type.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if test method is not null.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Resolves the method with the tolerances, more formally the method is searched first using its name.
    resolveMethod(double similarity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Resolves the method with the tolerances, more formally the method is searched first using its name.
    resolveMethod(Class<?> theClass, String methodName, double similarity, List<ParameterMatcher> parameters)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Resolves the method with the tolerances, more formally the method is searched first using its name.
    resolveMethod(Class<?> theClass, String methodName, double similarity, List<ParameterMatcher> parameters, boolean allowSuperClass)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Resolves the method with the tolerances, more formally the method is searched first using its name.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Represents a safe string as an array.
    void
    setAccessModifier(int accessModifier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the expected access modifier count to the new value.
    void
    setClassTester(ClassTester<?> classTester)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the class tester used to invoke the method to the specified value.
    void
    setLooseReturnTypeChecking(boolean looseReturnTypeChecking)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the boolean value whether to allow subtypes for the return type.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the method identifier containing the name of the method and the similarity to accept alternative identifiers to the specified value.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the expected parameters to the specified value.
    void
    setReturnType(Class<?> returnType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the expected class type of the test method to the specified value.
    void
    setTheMethod(Method theMethod)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the method that should be tested to the specified value.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Verifies that the method was declared correctly.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • allowSuperClass

      public boolean allowSuperClass
      Deprecated, for removal: This API element is subject to removal in a future version.
      Indicator if super class check are allowed.
  • Constructor Details

    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType, List<ParameterMatcher> parameters, boolean allowSuperClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
      accessModifier - the expected access modifier count
      returnType - the expected return type of the method
      parameters - the expected parameters of the method
      allowSuperClass - the indicator @param allowSuperClass the indicator if super class check are allowed
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType, List<ParameterMatcher> parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
      accessModifier - the expected access modifier count
      returnType - the expected return type of the method
      parameters - the expected parameters of the method
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType, ArrayList<ParameterMatcher> parameters, boolean allowSuperClass, boolean looseReturnTypeChecking)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
      accessModifier - the expected access modifier count
      returnType - the expected return type of the method
      parameters - the expected parameters of the method
      allowSuperClass - the indicator if super class check are allowed
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier, Class<?> returnType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
      accessModifier - the expected access modifier count
      returnType - the expected return type of the method
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity, int accessModifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
      accessModifier - the expected access modifier count
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity, Class<?> returnType, ArrayList<ParameterMatcher> parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
      returnType - the expected return type of the method
      parameters - the expected parameters of the method
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName, double similarity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
      similarity - the minimum matching similarity
    • MethodTester

      public MethodTester(ClassTester<?> classTester, String methodName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs and initializes a method tester.
      Parameters:
      classTester - the class tester used to invoke the method
      methodName - the expected method name to test
  • Method Details

    • getInvalidReturnTypeMessage

      public static String getInvalidReturnTypeMessage(String methodName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a predefined message for an invalid return type.
      Parameters:
      methodName - the method name used in the message
      Returns:
      a predefined message for an invalid return type.
    • getShouldNotHaveParameterMessage

      public static String getShouldNotHaveParameterMessage(String methodName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a predefined should not have parameter message.
      Parameters:
      methodName - the method name used in the message
      Returns:
      a predefined should not have parameter message
    • countMatchingParameters

      public static int countMatchingParameters(List<ParameterMatcher> expectedParameters, List<Parameter> actualParameters, boolean ignoreNames)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Counts the matching parameters.
      Parameters:
      expectedParameters - the expected parameters
      actualParameters - the actual Parameters
      ignoreNames - the indicator whether to ignore parameter names
      Returns:
      the number of matched parameters
    • countMatchingParameters

      public static int countMatchingParameters(Method m, String methodName, List<ParameterMatcher> parameters, boolean ignoreNames)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Counts the matching parameters.
      Parameters:
      m - the actual method with the parameters
      methodName - the name of the method
      parameters - the expected parameters
      ignoreNames - the indicator whether to ignore parameter names
      Returns:
      the number of matched parameters
    • assertParametersMatch

      public static void assertParametersMatch(List<ParameterMatcher> expectedParameters, List<Parameter> actualParameters, boolean ignoreNames)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the method parameters match.
      Parameters:
      expectedParameters - the expected parameters
      actualParameters - the actual parameters
      ignoreNames - the indicator whether to ignore parameter names
    • assertParametersMatch

      public static void assertParametersMatch(Method m, String methodName, List<ParameterMatcher> parameters, boolean ignoreNames)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the method parameters match.
      Parameters:
      m - the actual method to verify
      methodName - the expected name of the method
      parameters - the expected parameter
      ignoreNames - the indicator whether to ignore parameter names
    • assertParametersMatch

      public void assertParametersMatch()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the method parameters matches with the expected parameters.
    • assertMethodNotNull

      public static void assertMethodNotNull(Method m, String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the specified method is not null.
      Parameters:
      m - the method to check
      name - the expected method name of the method to check
    • getClassTesterNullMessage

      public static String getClassTesterNullMessage(String methodName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a predefined class tester null message.
      Parameters:
      methodName - the expected method name
      Returns:
      a predefined class tester null message
    • safeArrayToString

      public static String safeArrayToString(Object... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Represents a safe string as an array.
      Parameters:
      array - the array to convert
      Returns:
      the string representation of the array
    • getAllMethods

      public static List<Method> getAllMethods(Class<?> clazz)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns all fields from a class and its super classes recursively.
      Parameters:
      clazz - the class to search
      Returns:
      all fields from a class and its super classes
    • getClassTester

      public ClassTester<?> getClassTester()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the class tester used to invoke the method.
      Returns:
      the class tester used to invoke the method
    • setClassTester

      public void setClassTester(ClassTester<?> classTester)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the class tester used to invoke the method to the specified value.
      Parameters:
      classTester - the new class tester value
    • getMethodIdentifier

      public IdentifierMatcher getMethodIdentifier()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the method identifier containing the name of the method and the similarity to accept alternative identifiers.
      Returns:
      method identifier containing the name of the method and the similarity to accept alternative identifiers
    • setMethodIdentifier

      public void setMethodIdentifier(IdentifierMatcher methodIdentifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the method identifier containing the name of the method and the similarity to accept alternative identifiers to the specified value.
      Parameters:
      methodIdentifier - the new method identifier
    • getReturnType

      public Class<?> getReturnType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the expected class type of the test method.
      Returns:
      the expected class type of the test method
    • setReturnType

      public void setReturnType(Class<?> returnType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the expected class type of the test method to the specified value.
      Parameters:
      returnType - the new return type
    • isLooseReturnTypeChecking

      public boolean isLooseReturnTypeChecking()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if subtype are allowed for the return type.
      Returns:
      true if subtype are allowed for the return type
    • setLooseReturnTypeChecking

      public void setLooseReturnTypeChecking(boolean looseReturnTypeChecking)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the boolean value whether to allow subtypes for the return type.
      Parameters:
      looseReturnTypeChecking - the indicator whether to allow it or not
    • assertReturnType

      public void assertReturnType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the actual return type matches the expected return type.
    • verify

      public MethodTester verify()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Verifies that the method was declared correctly.
      Returns:
      this method tester
    • getParameters

      public List<ParameterMatcher> getParameters()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the expected parameters.
      Returns:
      the expected parameters
    • setParameters

      public void setParameters(List<ParameterMatcher> parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the expected parameters to the specified value.
      Parameters:
      parameters - the new expected parameters
    • getTheMethod

      public Method getTheMethod()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the method that should be tested.
      Returns:
      the method that should be tested
    • setTheMethod

      public void setTheMethod(Method theMethod)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the method that should be tested to the specified value.
      Parameters:
      theMethod - the new method to be tested
    • addParameter

      public void addParameter(ParameterMatcher... parameterMatchers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an expected parameters' matcher to this tester.
      Parameters:
      parameterMatchers - the parameters' matcher to add
    • addParameter

      public void addParameter(Class<?> type, String name, double similarity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an expected parameters' matcher to this tester.
      Parameters:
      type - the type of the expected parameter type
      name - the name of the parameter to match
      similarity - the minimum required similarity
    • addParameter

      public void addParameter(Class<?> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an expected parameter matchers to this tester.
      Parameters:
      type - the type of the expected parameter type
    • getMethodNotFoundMessage

      public static String getMethodNotFoundMessage(String methodName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a predefined method not found message.
      Parameters:
      methodName - the name of the method used for the message
      Returns:
      a predefined method not found message
    • getMethodNotFoundMessage

      public String getMethodNotFoundMessage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a predefined method not found message.
      Returns:
      a predefined method not found message
    • methodResolved

      public boolean methodResolved()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if test method is not null.
      Returns:
      true if test method is not null
    • assertMethodResolved

      public void assertMethodResolved()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the test method could be resolved.
    • assertClassTesterNotNull

      public void assertClassTesterNotNull()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the class tester used to invoke the method is not null.
    • classResolved

      public boolean classResolved()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the class tester used to invoke the method is not null and can be resolved.
      Returns:
      true if the class tester used to invoke the method is not null and can be resolved
    • assertClassResolved

      public void assertClassResolved()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the class tester used to invoke the method can be resolved.
    • invokeable

      public boolean invokeable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if the method can be invoked, more formally returns true if the class tester used to invoke the method, the method itself can be resolved.
      Returns:
      true if the method can be invoked.
    • assertInvokeable

      public void assertInvokeable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the method can be invoked.
      See Also:
    • invoke

      public Object invoke(Object... params)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invokes test method using the class tester.
      Parameters:
      params - the parameters of the method that should be invoked
      Returns:
      the return value of the method after its invocation
    • getInvocations

      public List<org.mockito.invocation.Invocation> getInvocations()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the invocations of the test method.
      Returns:
      the invocations of the test method
    • getInvocationCount

      public int getInvocationCount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the number of invocations. (How often Has the test method been invoked?)
      Returns:
      the number of invocations
    • getRandomParams

      public Object[] getRandomParams()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the random valid parameter values.
      Returns:
      the random valid parameter values
    • invokeWithRandomParams

      public Object invokeWithRandomParams()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invokes the test method with random parameters.
      Returns:
      the return value of the method after its invocation
    • assertConstructsNotUsed

      public void assertConstructsNotUsed(List<Class<? extends spoon.reflect.code.CtCodeElement>> disallowedConstructs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether none of the blacklisted constructs where used in the constructor.
      Parameters:
      disallowedConstructs - the not allowed constructs in the constructor
    • assertReturnValueEquals

      public void assertReturnValueEquals(Object expected, Object... params)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the return value after the invocation with the specified parameters are correct.
      Parameters:
      expected - the expected return value
      params - the parameters used for the invocation
    • assertReturnValueEquals

      public void assertReturnValueEquals(Object expected, String additionalMessage, Object... params)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the return value after the invocation with the specified parameters are correct.
      Parameters:
      expected - the expected return value
      additionalMessage - the additional message if the test fails
      params - the parameters used for the invocation
    • getAccessModifier

      public int getAccessModifier()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the expected access modifier count.
      Returns:
      the expected access modifier count
    • 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 count to the new 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 actual access modifier count matches with the expected one.
    • resolveMethod

      public Method resolveMethod(Class<?> theClass, String methodName, double similarity, List<ParameterMatcher> parameters, boolean allowSuperClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the method with the tolerances, more formally the method is searched first using its name. If multiple overloads are found then the method with the most matching parameters according to countMatchingParameters(Method, String, List, boolean) is chosen.
      Parameters:
      theClass - the class to search
      methodName - the expected method name
      similarity - the minimum required similarity
      parameters - the expected parameters
      allowSuperClass - the indicator whether to search in super classes as well
      Returns:
      the resolved method
      See Also:
    • resolveMethod

      public Method resolveMethod(Class<?> theClass, String methodName, double similarity, List<ParameterMatcher> parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the method with the tolerances, more formally the method is searched first using its name. If multiple overloads are found then the method with the most matching parameters according to countMatchingParameters(Method, String, List, boolean) is chosen.
      Parameters:
      theClass - the class to search
      methodName - the expected method name
      similarity - the minimum required similarity
      parameters - the expected parameters
      Returns:
      the resolved method
      See Also:
    • resolveMethod

      public Method resolveMethod(double similarity)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the method with the tolerances, more formally the method is searched first using its name. If multiple overloads are found then the method with the most matching parameters according to countMatchingParameters(Method, String, List, boolean) is chosen.
      Parameters:
      similarity - the minimum required similarity
      Returns:
      the resolved method
      See Also:
    • resolveMethod

      public Method resolveMethod()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the method with the tolerances, more formally the method is searched first using its name. If multiple overloads are found then the method with the most matching parameters according to countMatchingParameters(Method, String, List, boolean) is chosen.
      Returns:
      the resolved method
      See Also:
    • assureMethodResolved

      public MethodTester assureMethodResolved()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Assures that the method has been resolved.
      Returns:
      this method tester