Logo Search packages:      
Sourcecode: jmock2 version File versions  Download package

Object org::jmock::lib::script::ScriptedAction::invoke ( Invocation  invocation  )  throws Throwable [inline]

Performs an action in response to an invocation.

Parameters:
invocation The invocation to perform.
Returns:
The result of the invocation, if not throwing an exception. Must return null if the invoked method has a void return type.
Exceptions:
Throwable An exception to be thrown to the caller, if not returning a value. Any checked exception thrown must be in the throws list of the invoked method.

Implements org::jmock::api::Invokable.

Definition at line 49 of file ScriptedAction.java.

                                                                 {
        try {
            defineParameters(interpreter, invocation);
            return interpreter.eval(script);
        }
        catch (TargetError e) {
            throw e.getTarget();
        }
        catch (EvalError e) {
            throw new IllegalArgumentException("could not interpret script", e);
        }
    }


Generated by  Doxygen 1.6.0   Back to index