org.jmock.lib.script
Class ScriptedAction

An Action that executes a BeanShell script.
This makes it easy to implement custom actions, especially those that call back to objects
passed to the mocked method as parameters.

To use a scripted action in an expectation, statically import the perform
method and call it within the will(...) clause of the expectation.

The script can refer to the parameters of the mocked method by the names $0 (the first parameter), $1, $2, etc,
and to the mock object that has been invoked by the name $this.
You can define other script variables by calling the action's where method.