Package org.jmock.core
Interface Stub
-
- All Superinterfaces:
SelfDescribing
- All Known Implementing Classes:
CustomStub
,DefaultResultStub
,DoAllStub
,ReturnIteratorStub
,ReturnStub
,StubSequence
,TestFailureStub
,ThrowStub
,VoidStub
public interface Stub extends SelfDescribing
An object that stubs the behaviour of a invokedMethod invocation on behalf of anInvokable
object.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
invoke(Invocation invocation)
Processes the invocation.-
Methods inherited from interface org.jmock.core.SelfDescribing
describeTo
-
-
-
-
Method Detail
-
invoke
java.lang.Object invoke(Invocation invocation) throws java.lang.Throwable
Processes the invocation.- Parameters:
invocation
- The invocation to stub.- Returns:
- The result of the invocation, if not throwing an exception.
Must return
null
if the invocation is of a invokedMethod with a void return type. - Throws:
java.lang.Throwable
- An exception to be thrown to the caller, if not returning a value. A checked exception thrown from this invokedMethod must be in thethrows
list of the invoked method.
-
-