DefaultBehavior
| Kind of class: | class |
|---|---|
| Inherits from: | BasicClass |
| Implements: | |
| Author: | Simon Wacker |
| Classpath: | org.as2lib.test.mock.support.DefaultBehavior |
| File last modified: | Friday, 01 July 2005, 19:57:42 |
DefaultBehavior stores expected behaviors and exposes them forverification.
Summary
Constructor
Instance methods
- getMethodBehaviorFactory
- setMethodBehaviorFactory
- addMethodBehavior
- createMethodBehavior
- getMethodBehavior
- getLastMethodBehavior
- removeAllBehaviors
- verify
Instance methods inherited from BasicClass
Constructor
DefaultBehavior
function DefaultBehavior (
Void)
Constructs a new
DefaultBehavior instance.Instance methods
addMethodBehavior
function addMethodBehavior (
methodName:String,
methodBehavior:MethodBehavior) : Void
Adds the given
methodBehavior behavior for the passed-inmethodName.If the passed-in methodName is null or an empty string the one
returned by the method behaviour's expected method call will be used. If this
is also null or an empty string "[unknown]" will be used.
Throws:
Specified by:
createMethodBehavior
function createMethodBehavior (
expectedMethodCall:MethodCall) : MethodBehavior
Creates a new method behavior for the passed-in
expectedMethodCall.Parameters:
expectedMethodCall:
the method call to create a behavior for
Returns:
the created method behavior
See also:
Specified by:
getLastMethodBehavior
function getLastMethodBehavior (
Void) : MethodBehavior
Returns the lastly added method behavior.
Returns:
the lastly added method behavior
Specified by:
getMethodBehavior
function getMethodBehavior (
actualMethodCall:MethodCall) : MethodBehavior
Returns a method behavior that matches the given
actualMethodCall.null will be returned if:
- The passed-in
actualMethodCallisnull. - There is no matching behavior registered.
Returns:
a matching method behavior
Specified by:
getMethodBehaviorFactory
function getMethodBehaviorFactory (
Void) : MethodBehaviorFactory
Returns either the factory set via setMethodBehaviorFactory or the
default one which returns an instance of class DefaultMethodBehavior.
default one which returns an instance of class DefaultMethodBehavior.
Returns:
the currently used factory to obtain method call behaviors
removeAllBehaviors
function removeAllBehaviors (
Void) : Void
Removes all added behaviors.
Specified by:
setMethodBehaviorFactory
function setMethodBehaviorFactory (
methodBehaviorFactory:MethodBehaviorFactory) : Void
Sets the factory used to obtain method call behaviors to store state.
If methodBehaviorFactory is null the
getMethodBehaviorFactory method will return the default factory.
Parameters:
methodBehaviorFactory:
the new factory
verify
function verify (
Void) : Void
Verifies all added behaviors.
Specified by: