Package org.jmock.core
Class AbstractInvocationDispatcher
- java.lang.Object
-
- org.jmock.core.AbstractInvocationDispatcher
-
- All Implemented Interfaces:
InvocationDispatcher
,SelfDescribing
,Verifiable
- Direct Known Subclasses:
FIFOInvocationDispatcher
,LIFOInvocationDispatcher
public abstract class AbstractInvocationDispatcher extends java.lang.Object implements InvocationDispatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected Stub
defaultStub
protected java.util.List
invokables
static java.lang.String
NO_EXPECTATIONS_MESSAGE
-
Constructor Summary
Constructors Constructor Description AbstractInvocationDispatcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(Invokable invokable)
void
clear()
java.lang.StringBuffer
describeTo(java.lang.StringBuffer buffer)
Appends the description of this object to the buffer.java.lang.Object
dispatch(Invocation invocation)
protected abstract java.util.Iterator
dispatchOrder(java.util.List invokablesList)
void
setDefaultStub(Stub defaultStub)
void
verify()
Throw an AssertionFailedException if any expectations have not been met.
-
-
-
Field Detail
-
NO_EXPECTATIONS_MESSAGE
public static final java.lang.String NO_EXPECTATIONS_MESSAGE
- See Also:
- Constant Field Values
-
invokables
protected java.util.List invokables
-
defaultStub
protected Stub defaultStub
-
-
Method Detail
-
setDefaultStub
public void setDefaultStub(Stub defaultStub)
- Specified by:
setDefaultStub
in interfaceInvocationDispatcher
-
add
public void add(Invokable invokable)
- Specified by:
add
in interfaceInvocationDispatcher
-
verify
public void verify()
Description copied from interface:Verifiable
Throw an AssertionFailedException if any expectations have not been met. Implementations of this method must be idempotent: jMock can call this method more than once when verifying expectations at the end of a test.- Specified by:
verify
in interfaceVerifiable
-
clear
public void clear()
- Specified by:
clear
in interfaceInvocationDispatcher
-
describeTo
public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)
Description copied from interface:SelfDescribing
Appends the description of this object to the buffer.- Specified by:
describeTo
in interfaceSelfDescribing
- Parameters:
buffer
- The buffer that the description is appended to.- Returns:
- The buffer passed to the invokedMethod.
-
dispatch
public java.lang.Object dispatch(Invocation invocation) throws java.lang.Throwable
- Specified by:
dispatch
in interfaceInvocationDispatcher
- Throws:
java.lang.Throwable
-
dispatchOrder
protected abstract java.util.Iterator dispatchOrder(java.util.List invokablesList)
-
-