| java.lang.Object org.kuali.test.MockMethod
MockMethod | public class MockMethod (Code) | | This class implements a method for a
MockService .
|
Method Summary | |
public String | getName() | public Object | invoke(Object proxy, Method method, Object[] args) Returns the result associated with the given list of arguments (regardless of the given method). | public void | setResult(Object result, Object[] args) Sets a result from this method for the given list of arguments.
Parameters: result - the result to return for invoking with the given args Parameters: args - the arguments to associate with the given result. |
MockMethod | public MockMethod(String name, Object noResultFallback)(Code) | | Constructs a new instance.
Parameters: name - the name of the method to mock Parameters: noResultFallback - the Object on which to actually invoke this method if no mock results are associated, or null if ajunit.framework.AssertionFailedError should be thrown in this case instead. |
invoke | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable(Code) | | Returns the result associated with the given list of arguments (regardless of the given method). If there are no associated
results, invokes the given method on the noResultFallback Object. If the noResultFallback Object is null, throws a
junit.framework.AssertionFailedError .
See Also: java.lang.reflect.InvocationHandler.invoke |
setResult | public void setResult(Object result, Object[] args)(Code) | | Sets a result from this method for the given list of arguments.
Parameters: result - the result to return for invoking with the given args Parameters: args - the arguments to associate with the given result. The given array is copied, but if the hashCode or equality ofObjects in this array change, then the invoke method may fail to find the associated result. |
|
|