IMocksControl (EasyMock 2.5.2 API)
Date: 2009-09-12

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.easymock
Interface IMocksControl

    public interface IMocksControl

Controls all the mock objects created by it. For details, see the EasyMock documentation.

Method Summary
`void` | `checkIsUsedInOneThread(boolean shouldBeUsedInOneThread)` Check that the mock is called from only one thread
`void` | `checkOrder(boolean state)` Switches order checking on and off.
`
`<T> T`
` | `createMock(java.lang.Class<T> toMock)` Creates a mock object that implements the given interface.
`
`<T> T`
` | `createMock(java.lang.String name, java.lang.Class<T> toMock)` Creates a mock object that implements the given interface.
`void` | `makeThreadSafe(boolean threadSafe)` Makes the mock thread safe.
`void` | `replay()` Switches the control from record mode to replay mode.
`void` | `reset()` Removes all expectations for the mock objects of this control.
`void` | `resetToDefault()` Removes all expectations for the mock objects of this control and turn them to default mocks.
`void` | `resetToNice()` Removes all expectations for the mock objects of this control and turn them to nice mocks.
`void` | `resetToStrict()` Removes all expectations for the mock objects of this control and turn them to strict mocks.
`void` | `verify()` Verifies that all expectations were met.

Method Detail

### createMock

    <T> T createMock(java.lang.Class<T> toMock)

  Creates a mock object that implements the given interface.

  Type Parameters:
    `T` - the interface that the mock object should implement.
  Parameters:
    `toMock` - the class of the interface that the mock object should implement.
  Returns:
    the mock object.

### createMock

    <T> T createMock(java.lang.String name,
                     java.lang.Class<T> toMock)

  Creates a mock object that implements the given interface.

  Type Parameters:
    `T` - the interface that the mock object should implement.
  Parameters:
    `name` - the name of the mock object .
    `toMock` - the class of the interface that the mock object should implement.
  Returns:
    the mock object.
  Throws:
    `java.lang.IllegalArgumentException` - if the name is not a valid Java identifier.

### reset

    void reset()

  Removes all expectations for the mock objects of this control.

### resetToNice

    void resetToNice()

  Removes all expectations for the mock objects of this control and turn them to nice mocks.

### resetToDefault

    void resetToDefault()

  Removes all expectations for the mock objects of this control and turn them to default mocks.

### resetToStrict

    void resetToStrict()

  Removes all expectations for the mock objects of this control and turn them to strict mocks.

### replay

    void replay()

  Switches the control from record mode to replay mode.

### verify

    void verify()

  Verifies that all expectations were met.

### checkOrder

    void checkOrder(boolean state)

  Switches order checking on and off.

  Parameters:
    `state` - `true` switches order checking on, `false` switches it off.

### makeThreadSafe

    void makeThreadSafe(boolean threadSafe)

  Makes the mock thread safe.

  Parameters:
    `threadSafe` - If the mock should be thread safe or not

### checkIsUsedInOneThread

    void checkIsUsedInOneThread(boolean shouldBeUsedInOneThread)

  Check that the mock is called from only one thread

  Parameters:
    `shouldBeUsedInOneThread` - If it should be used in one thread only or not

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2009 OFFIS, Tammo Freese, Henri Tremblay. This documentation is provided under the terms of the Apache 2 licence.