|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.easymock.MockControl
org.easymock.classextension.MockClassControl
Instances of MockControl
control the behavior of their
associated mock objects. For more information, see the EasyMock
documentation.
Field Summary |
Fields inherited from class org.easymock.MockControl |
ALWAYS_MATCHER, ARRAY_MATCHER, EQUALS_MATCHER, NICE_BEHAVIOR_FACTORY, ONE, ONE_OR_MORE, ORDERED_BEHAVIOR_FACTORY, UNORDERED_BEHAVIOR_FACTORY, ZERO_OR_MORE |
Method Summary | |
static org.easymock.MockControl |
createControl(java.lang.Class classToMock)
Does the same thing as above, but tries to use the best constructor. |
static MockClassControl |
createControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs)
Creates a mock control object for the specified class and construct an instance using the constructor that matches constructorTypes
with parameters constructorArgs . |
static MockClassControl |
createControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs,
java.lang.reflect.Method[] mockedMethods)
Do the same as above but allows to pass a list of methods to mock. |
static org.easymock.MockControl |
createNiceControl(java.lang.Class classToMock)
Does the same thing as above, but tries to use the first constructor found. |
static MockClassControl |
createNiceControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs)
Creates a mock control object for the specified class and construct an instance using the constructor that matches constructorTypes |
static MockClassControl |
createNiceControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs,
java.lang.reflect.Method[] mockedMethods)
Do the same as above but allows to pass a list of methods to mock. |
static org.easymock.MockControl |
createStrictControl(java.lang.Class classToMock)
Does the same thing as above, but tries to use the first constructor found. |
static MockClassControl |
createStrictControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs)
Creates a mock control object for the specified class and construct an instance using the constructor that matches constructorTypes |
static MockClassControl |
createStrictControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs,
java.lang.reflect.Method[] mockedMethods)
Do the same as above but allows to pass a list of methods to mock. |
Methods inherited from class org.easymock.MockControl |
expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndReturn, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, expectAndThrow, getMock, replay, reset, setDefaultMatcher, setDefaultReturnValue, setDefaultReturnValue, setDefaultReturnValue, setDefaultReturnValue, setDefaultReturnValue, setDefaultThrowable, setDefaultVoidCallable, setMatcher, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setReturnValue, setThrowable, setThrowable, setThrowable, setThrowable, setVoidCallable, setVoidCallable, setVoidCallable, setVoidCallable, verify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static MockClassControl createControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs)
constructorTypes
with parameters constructorArgs
.
The MockControl
and its
associated mock object
will not check the order of expected method calls.
An unexpected method call on the mock object will
lead to an AssertionFailedError
.
classToMock
- the class to mock.constructorTypes
- Class types of arguments in constructor to use
to instantiate objectconstructorArgs
- objects to pass to constructor.
public static MockClassControl createControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs, java.lang.reflect.Method[] mockedMethods)
public static org.easymock.MockControl createControl(java.lang.Class classToMock)
createControl(Class, Class[], Object[])
to be able to use your own params and constructor.
org.easymock.MockClassControl#createControl(java.lang.Class, java.lang.Class[], java.lang.Object[])
public static MockClassControl createStrictControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs)
constructorTypes
with parameters constructorArgs
.
The MockControl
and its
associated mock object
will check the order of expected method calls.
An unexpected method call on the mock object will
lead to an AssertionFailedError
.
- Parameters:
classToMock
- the class to mock.constructorTypes
- Class types of arguments in constructor to use
to instantiate objectconstructorArgs
- objects to pass to constructor.
- Returns:
- the mock control.
public static MockClassControl createStrictControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs, java.lang.reflect.Method[] mockedMethods)
public static org.easymock.MockControl createStrictControl(java.lang.Class classToMock)
org.easymock.MockClassControl#createStrictControl(java.lang.Class, java.lang.Class[], java.lang.Object[])
public static MockClassControl createNiceControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs)
constructorTypes
with parameters constructorArgs
.
The MockControl
and its
associated mock object
will not the order of expected method calls.
An unexpected method call on the mock object will
return an empty value (0, null, false).
- Parameters:
classToMock
- the class to mock.constructorTypes
- Class types of arguments in constructor to use
to instantiate objectconstructorArgs
- objects to pass to constructor.
- Returns:
- the mock control.
public static MockClassControl createNiceControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs, java.lang.reflect.Method[] mockedMethods)
public static org.easymock.MockControl createNiceControl(java.lang.Class classToMock)
org.easymock.MockClassControl#createNiceControl(java.lang.Class, java.lang.Class[], java.lang.Object[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |