Class org.as2lib.test.mock.MethodResponse

org.as2lib.core.BasicClass
   +--org.as2lib.test.mock.MethodResponse

Description

MethodResponse holds and carries out the response if requested.

Method Index

new MethodResponse()

response(), setReturnValue(), setThrowable()

Inherited from BasicClass

toString()

Constructor Detail

MethodResponse

public function MethodResponse(Void)

Constructs a new MethodResponse instance.

Method Detail

setReturnValue

public function setReturnValue(returnValue):Void

Sets the return value that is returned when invoking the response method.

Setting a return value disables the throwable behavior.

Parameters

returnValuethe return value to return

setThrowable

public function setThrowable(throwable):Void

Sets the throwable to throw when the response method is invoked.

Setting a throwable disables the return value behavior.

Parameters

throwablethe throwable to throw

response

public function response(Void)

Returns the set return value or throws the set throwable. If both have been set the one that has been set at last will be used.

Return

the set return value

Throws

theset throwable