public class EasyMockSupport
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<IMocksControl> |
controls
List of all controls created
|
Constructor and Description |
---|
EasyMockSupport() |
Modifier and Type | Method and Description |
---|---|
IMocksControl |
createControl()
Creates a control, order checking is disabled by default.
|
<T> T |
createMock(java.lang.Class<T> toMock)
Creates a mock object that implements the given interface, order checking
is disabled by default.
|
<T> T |
createMock(java.lang.String name,
java.lang.Class<T> toMock)
Creates a mock object that implements the given interface, order checking
is disabled by default.
|
IMocksControl |
createNiceControl()
Creates a control, order checking is disabled by default, and the mock
objects created by this control will return
0 ,
null or false for unexpected invocations. |
<T> T |
createNiceMock(java.lang.Class<T> toMock)
Creates a mock object that implements the given interface, order checking
is disabled by default, and the mock object will return
0 ,
null or false for unexpected invocations. |
<T> T |
createNiceMock(java.lang.String name,
java.lang.Class<T> toMock)
Creates a mock object that implements the given interface, order checking
is disabled by default, and the mock object will return
0 ,
null or false for unexpected invocations. |
IMocksControl |
createStrictControl()
Creates a control, order checking is enabled by default.
|
<T> T |
createStrictMock(java.lang.Class<T> toMock)
Creates a mock object that implements the given interface, order checking
is enabled by default.
|
<T> T |
createStrictMock(java.lang.String name,
java.lang.Class<T> toMock)
Creates a mock object that implements the given interface, order checking
is enabled by default.
|
void |
replayAll()
Switches all registered mock objects (more exactly: the controls of the
mock objects) to replay mode.
|
void |
resetAll()
Resets all registered mock objects (more exactly: the controls of the
mock objects).
|
void |
resetAllToDefault()
Resets all registered mock objects (more exactly: the controls of the
mock objects) and turn them to a mock with default behavior.
|
void |
resetAllToNice()
Resets all registered mock objects (more exactly: the controls of the
mock objects) and turn them to a mock with nice behavior.
|
void |
resetAllToStrict()
Resets all registered mock objects (more exactly: the controls of the
mock objects) and turn them to a mock with strict behavior.
|
void |
verifyAll()
Verifies all registered mock objects (more exactly: the controls of the
mock objects).
|
protected final java.util.List<IMocksControl> controls
public <T> T createStrictMock(java.lang.Class<T> toMock)
T
- the interface that the mock object should implement.toMock
- the class of the interface that the mock object should
implement.public <T> T createStrictMock(java.lang.String name, java.lang.Class<T> toMock)
T
- the interface that the mock object should implement.name
- the name of the mock object.toMock
- the class of the interface that the mock object should
implement.java.lang.IllegalArgumentException
- if the name is not a valid Java identifier.public <T> T createMock(java.lang.Class<T> toMock)
T
- the interface that the mock object should implement.toMock
- the class of the interface that the mock object should
implement.public <T> T createMock(java.lang.String name, java.lang.Class<T> toMock)
T
- the interface that the mock object should implement.name
- the name of the mock object.toMock
- the class of the interface that the mock object should
implement.java.lang.IllegalArgumentException
- if the name is not a valid Java identifier.public <T> T createNiceMock(java.lang.Class<T> toMock)
0
,
null
or false
for unexpected invocations.T
- the interface that the mock object should implement.toMock
- the class of the interface that the mock object should
implement.public <T> T createNiceMock(java.lang.String name, java.lang.Class<T> toMock)
0
,
null
or false
for unexpected invocations.T
- the interface that the mock object should implement.name
- the name of the mock object.toMock
- the class of the interface that the mock object should
implement.java.lang.IllegalArgumentException
- if the name is not a valid Java identifier.public IMocksControl createStrictControl()
public IMocksControl createControl()
public IMocksControl createNiceControl()
0
,
null
or false
for unexpected invocations.public void replayAll()
public void resetAll()
public void verifyAll()
public void resetAllToNice()
public void resetAllToDefault()
public void resetAllToStrict()
Copyright © 2001-2009 OFFIS, Tammo Freese, Henri Tremblay. This documentation is provided under the terms of the MIT licence.]]>