Access keys

MockControlState

Kind of class: interface
Inherits from: BasicInterface
Implemented by:
Author: Simon Wacker
Classpath: org.as2lib.test.mock.MockControlState
File last modified: Sunday, 10 April 2005, 11:53:36
MockControlState determines most of the actual behavior of the
MockControl class.

The actual behavior of the specific methods of this class depends largely on
the implementing class. Thus refer to these implementation classes.

Summary

Instance methods
Instance methods inherited from BasicInterface

Instance methods

invokeMethod

function invokeMethod (
Is called when a method is called on the mock proxy.
Parameters:
call:
contains all information about the method call
Returns:
the return value of the method invocation in replay state
Throws:
if the method is set up to throw a throwable in replay state

setArgumentsMatcher

function setArgumentsMatcher (
argumentsMatcher:ArgumentsMatcher) : Void
Sets a new arguments matcher.


Record State

Sets the arguments matcher that will be used for the last method specified
by a method call.

Replay State

Throws an IllegalStateException.

Parameters:
argumentsMatcher:
the arguments matcher to use for the specific method

setMethodResponse

function setMethodResponse (
methodResponse:MethodResponse, methodCallRange:MethodCallRange) : Void
Sets a new method response.


Record State

Records that the mock object will expect the last method call the
specified number of times, and will react by either returning the
return value, throwing an exception or just doing nothing.

Replay State

Throws an IllegalStateException.

Parameters:
methodResponse :
handles incoming requests appropriately
methodCallRange:
stores the minimum and maximum quantity of method calls

verify

function verify (
Void) : Void
Verifies the beahvior.


Replay State

Verifies that all expectations have been met.

Record State

Throws an IllegalStateException.
Throws:
AssertionFailedError if any expectation has not
been met in replay state
org.as2lib.env.except.IllegalArgumentException when in record state