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

Method Summary
 java.lang.Object invocation(java.lang.Object[] arguments, MethodHandle methodHandle)
          Called when an invocation is made.
 

Method Detail

invocation

java.lang.Object invocation(java.lang.Object[] arguments,
                            MethodHandle methodHandle)
                            throws java.lang.Throwable
Called when an invocation is made.

Parameters:
arguments - The arguments passed to the invoked method
methodHandle - 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.
java.lang.Throwable


Copyright © 2005-2008 Agical AB. All Rights Reserved.