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 StubdefaultStubprotected java.util.Listinvokablesstatic java.lang.StringNO_EXPECTATIONS_MESSAGE
-
Constructor Summary
Constructors Constructor Description AbstractInvocationDispatcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(Invokable invokable)voidclear()java.lang.StringBufferdescribeTo(java.lang.StringBuffer buffer)Appends the description of this object to the buffer.java.lang.Objectdispatch(Invocation invocation)protected abstract java.util.IteratordispatchOrder(java.util.List invokablesList)voidsetDefaultStub(Stub defaultStub)voidverify()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:
setDefaultStubin interfaceInvocationDispatcher
-
add
public void add(Invokable invokable)
- Specified by:
addin interfaceInvocationDispatcher
-
verify
public void verify()
Description copied from interface:VerifiableThrow 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:
verifyin interfaceVerifiable
-
clear
public void clear()
- Specified by:
clearin interfaceInvocationDispatcher
-
describeTo
public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)
Description copied from interface:SelfDescribingAppends the description of this object to the buffer.- Specified by:
describeToin 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:
dispatchin interfaceInvocationDispatcher- Throws:
java.lang.Throwable
-
dispatchOrder
protected abstract java.util.Iterator dispatchOrder(java.util.List invokablesList)
-
-