AbstractInvocationDispatcher
Date: 2015-09-15

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 and Description
    --- | ---
    `protected Stub` | `defaultStub`
    `protected java.util.List` | `invokables`
    `static java.lang.String` | `NO_EXPECTATIONS_MESSAGE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractInvocationDispatcher()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

  - ### Constructor Detail

    - #### AbstractInvocationDispatcher

          public AbstractInvocationDispatcher()

  - ### Method Detail

    - #### setDefaultStub

          public void setDefaultStub(Stub defaultStub)

      Specified by:
        `setDefaultStub` in interface `InvocationDispatcher`

    - #### add

          public void add(Invokable invokable)

      Specified by:
        `add` in interface `InvocationDispatcher`

    - #### 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 interface `Verifiable`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `InvocationDispatcher`

    - #### 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 interface `SelfDescribing`
      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 interface `InvocationDispatcher`
      Throws:
        `java.lang.Throwable`

    - #### dispatchOrder

          protected abstract java.util.Iterator dispatchOrder(java.util.List invokablesList)