org.easymock

Interface IMocksControl

public interface IMocksControl

Controls all the mock objects created by it. For details, see the EasyMock documentation.
Method Summary
voidcheckIsUsedInOneThread(boolean shouldBeUsedInOneThread)
Check that the mock is called from only one thread
voidcheckOrder(boolean state)
Switches order checking on and off.
<T> TcreateMock(Class<T> toMock)
Creates a mock object that implements the given interface.
<T> TcreateMock(String name, Class<T> toMock)
Creates a mock object that implements the given interface.
voidmakeThreadSafe(boolean threadSafe)
Makes the mock thread safe.
voidreplay()
Switches the control from record mode to replay mode.
voidreset()
Removes all expectations for the mock objects of this control.
voidresetToDefault()
Removes all expectations for the mock objects of this control and turn them to default mocks.
voidresetToNice()
Removes all expectations for the mock objects of this control and turn them to nice mocks.
voidresetToStrict()
Removes all expectations for the mock objects of this control and turn them to strict mocks.
voidverify()
Verifies that all expectations were met.

Method Detail

checkIsUsedInOneThread

public 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

checkOrder

public void checkOrder(boolean state)
Switches order checking on and off.

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

createMock

public <T> T createMock(Class<T> toMock)
Creates a mock object that implements the given interface.

Parameters: the interface that the mock object should implement. toMock the class of the interface that the mock object should implement.

Returns: the mock object.

createMock

public <T> T createMock(String name, Class<T> toMock)
Creates a mock object that implements the given interface.

Parameters: name the name of the mock object . toMock the class of the interface that the mock object should implement. the interface that the mock object should implement.

Returns: the mock object.

Throws: IllegalArgumentException if the name is not a valid Java identifier.

makeThreadSafe

public void makeThreadSafe(boolean threadSafe)
Makes the mock thread safe.

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

replay

public void replay()
Switches the control from record mode to replay mode.

reset

public void reset()
Removes all expectations for the mock objects of this control.

resetToDefault

public void resetToDefault()
Removes all expectations for the mock objects of this control and turn them to default mocks.

resetToNice

public void resetToNice()
Removes all expectations for the mock objects of this control and turn them to nice mocks.

resetToStrict

public void resetToStrict()
Removes all expectations for the mock objects of this control and turn them to strict mocks.

verify

public void verify()
Verifies that all expectations were met.
Copyright © 2001-2009 OFFIS, Tammo Freese, Henri Tremblay. This documentation is provided under the terms of the MIT licence.]]>