|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.aries.unittest.mocks.MethodCall
public final class MethodCall
This class represents a method call that has been or is expected to be made. It encapsulates the class that the call was made on, the method that was invoked and the arguments passed.
| Constructor Summary | |
|---|---|
MethodCall(Class<?> clazz,
String methodName,
Object... arguments)
This constructor allows a MethodCall to be created when the class can be located statically, rather than dynamically. |
|
| Method Summary | ||
|---|---|---|
boolean |
equals(Object obj)
Returns true if and only if the two object represent the same call. |
|
Object[] |
getArguments()
This method returns the arguments. |
|
String |
getClassName()
Returns the name of the class the method was invoked or was defined on. |
|
Class<?>[] |
getInterfaces()
This method returns the list of interfaces implemented by the class that was called. |
|
Object |
getInvokedObject()
This method returns the invoked object. |
|
String |
getMethodName()
Returns the name of the method that was (or will be) invoked. |
|
int |
hashCode()
Returns the hashCode (obtained by returning the hashCode of the methodName). |
|
static
|
registerEqualsHelper(Class<T> type,
Comparator<T> comparator)
The native equals for an object may not provide the behaviour required by the tests. |
|
static void |
removeEqualsHelper(Class<?> type)
This method removes any registered comparator specified for the given type. |
|
String |
toString()
Returns a string representation of the method call. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MethodCall(Class<?> clazz,
String methodName,
Object... arguments)
clazz - The class.methodName - The method name.arguments - The arguments.| Method Detail |
|---|
public Object[] getArguments()
public String getClassName()
public String getMethodName()
public boolean equals(Object obj)
equals in class Objectobj - The object to be compared.
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic Class<?>[] getInterfaces()
public Object getInvokedObject()
public static <T> void registerEqualsHelper(Class<T> type,
Comparator<T> comparator)
The Comparator must not throw exceptions, and must return 0 for equality or any other integer for inequality.
T - the type of the class and comparator.type - the type of the class for which the comparator will be called.comparator - the comparator to call.public static void removeEqualsHelper(Class<?> type)
type - the type to remove the comparator from.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||