com.agical.rmock.core
Interface Action
- All Known Implementing Classes:
- ForwardingAction, ReturnAction, ThrowsAction
public interface Action
Think of an action as a pluggable method body. When a call to a mocked or intercepted
method arrives, the action determines what will happen.
A typical action would be to return a value, throw an exception or create and return a
mock.
(c) Agical AB 2005
- Author:
- Joakim Ohlrogge
invocation
Object invocation(Object[] arguments,
MethodHandle methodHandle)
throws Throwable
- Called when an invocation is made.
- Parameters:
arguments
- The arguments passed to the invoked methodmethodHandle
- A method handle that can optionally be used to invoke the equivalent method
of the mocked/intercepted class.
- Returns:
- The value to return, null if this action represents a void method.
- Throws:
If
- this action represents a method that throws an exception, just throw away.
Throwable
Copyright © 2005-2011 Agical AB. All Rights Reserved.