AbstractDynamicMock
Date: 2015-09-15

org.jmock.core

## Class AbstractDynamicMock

- java.lang.Object
- - org.jmock.core.AbstractDynamicMock

- All Implemented Interfaces:
    DynamicMock, Verifiable
  Direct Known Subclasses:
    CGLIBCoreMock, CoreMock

      public abstract class AbstractDynamicMock
      extends java.lang.Object
      implements DynamicMock

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDynamicMock(java.lang.Class mockedType, java.lang.String name)`
    `AbstractDynamicMock(java.lang.Class mockedType, java.lang.String name, InvocationDispatcher invocationDispatcher)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addInvokable(Invokable invokable)`
    `java.lang.Class` | `getMockedType()`
    `java.lang.String` | `getMockName()`
    `protected java.lang.Object` | `mockInvocation(Invocation invocation)`
    `static java.lang.String` | `mockNameFromClass(java.lang.Class c)`
    `abstract java.lang.Object` | `proxy()`
    `void` | `reset()`
    `void` | `setDefaultStub(Stub newDefaultStub)`
    `java.lang.String` | `toString()`
    `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, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractDynamicMock

          public AbstractDynamicMock(java.lang.Class mockedType,
                             java.lang.String name)

    - #### AbstractDynamicMock

          public AbstractDynamicMock(java.lang.Class mockedType,
                             java.lang.String name,
                             InvocationDispatcher invocationDispatcher)

  - ### Method Detail

    - #### proxy

          public abstract java.lang.Object proxy()

      Specified by:
        `proxy` in interface `DynamicMock`

    - #### getMockedType

          public java.lang.Class getMockedType()

      Specified by:
        `getMockedType` in interface `DynamicMock`

    - #### setDefaultStub

          public void setDefaultStub(Stub newDefaultStub)

      Specified by:
        `setDefaultStub` in interface `DynamicMock`

    - #### addInvokable

          public void addInvokable(Invokable invokable)

      Specified by:
        `addInvokable` in interface `DynamicMock`

    - #### reset

          public void reset()

      Specified by:
        `reset` in interface `DynamicMock`

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

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getMockName

          public java.lang.String getMockName()

    - #### mockNameFromClass

          public static java.lang.String mockNameFromClass(java.lang.Class c)

    - #### mockInvocation

          protected java.lang.Object mockInvocation(Invocation invocation)
                                             throws java.lang.Throwable

      Throws:
        `java.lang.Throwable`