public class MockClassControl
extends org.easymock.MockControl
MockClassControl
control the behavior of their
associated mock objects. For more information, see the EasyMock
documentation.Modifier and Type | Method and Description |
---|---|
static org.easymock.MockControl |
createControl(java.lang.Class classToMock)
Creates a mock control object for the specified class or interface.
|
static MockClassControl |
createControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs)
Deprecated.
No need to pick a constructor anymore. Constructor arguments
are now ignored. Just use
createControl(Class) |
static MockClassControl |
createControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs,
java.lang.reflect.Method[] mockedMethods)
Deprecated.
No need to pick a constructor anymore. Constructor arguments
are now ignored. Just use
createControl(Class, Method[]) |
static MockClassControl |
createControl(java.lang.Class classToMock,
java.lang.reflect.Method[] mockedMethods)
Same as
createControl(Class) but allows to pass a list of
methods to mock. |
static org.easymock.MockControl |
createNiceControl(java.lang.Class classToMock)
Creates a mock control object for the specified class or interface.
|
static MockClassControl |
createNiceControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs)
Deprecated.
No need to pick a constructor anymore. Constructor arguments
are now ignored. Just use
createNiceControl(Class) |
static MockClassControl |
createNiceControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs,
java.lang.reflect.Method[] mockedMethods)
Deprecated.
No need to pick a constructor anymore. Constructor arguments
are now ignored. Just use
createNiceControl(Class, Method[]) |
static MockClassControl |
createNiceControl(java.lang.Class classToMock,
java.lang.reflect.Method[] mockedMethods)
Same as
createNiceControl(Class, Method[]) but allows to pass a
list of methods to mock. |
static org.easymock.MockControl |
createStrictControl(java.lang.Class classToMock)
Creates a mock control object for the specified class or interface.
|
static MockClassControl |
createStrictControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs)
Deprecated.
No need to pick a constructor anymore. Constructor arguments
are now ignored. Just use
createStrictControl(Class) |
static MockClassControl |
createStrictControl(java.lang.Class classToMock,
java.lang.Class[] constructorTypes,
java.lang.Object[] constructorArgs,
java.lang.reflect.Method[] mockedMethods)
Deprecated.
No need to pick a constructor anymore. Constructor arguments
are now ignored. Just use
createStrictControl(Class, Method[]) |
static MockClassControl |
createStrictControl(java.lang.Class classToMock,
java.lang.reflect.Method[] mockedMethods)
Same as
createStrictControl(Class) but allows to pass a list of
methods to mock. |
expectAndDefaultReturn, expectAndDefaultReturn, expectAndDefaultReturn, expectAndDefaultReturn, expectAndDefaultReturn, expectAndDefaultThrow, expectAndDefaultThrow, expectAndDefaultThrow, expectAndDefaultThrow, expectAndDefaultThrow, 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
public static org.easymock.MockControl createControl(java.lang.Class classToMock)
MockClassControl
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.MockClassControl
instance)public static MockClassControl createControl(java.lang.Class classToMock, java.lang.reflect.Method[] mockedMethods)
createControl(Class)
but allows to pass a list of
methods to mock. All the other methods won't be. It means that if these
methods are called, their real code will be executed.classToMock
- the class to mockmockedMethods
- Methods to be mocked. If null, all methods will be mocked.public static org.easymock.MockControl createStrictControl(java.lang.Class classToMock)
MockClassControl
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
.classToMock
- the class to mock.MockClassControl
instance)public static MockClassControl createStrictControl(java.lang.Class classToMock, java.lang.reflect.Method[] mockedMethods)
createStrictControl(Class)
but allows to pass a list of
methods to mock. All the other methods won't be. It means that if these
methods are called, their real code will be executed.classToMock
- the class to mockmockedMethods
- Methods to be mocked. If null, all methods will be mocked.public static org.easymock.MockControl createNiceControl(java.lang.Class classToMock)
MockClassControl
and its associated mock object will check not
the order of expected method calls. An unexpected method call on the mock
object will return an empty value (0, null, false).classToMock
- the class to mock.MockClassControl
instance)public static MockClassControl createNiceControl(java.lang.Class classToMock, java.lang.reflect.Method[] mockedMethods)
createNiceControl(Class, Method[])
but allows to pass a
list of methods to mock. All the other methods won't be. It means that if
these methods are called, their real code will be executed.classToMock
- the class to mockmockedMethods
- Methods to be mocked. If null, all methods will be mocked.public static MockClassControl createControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs)
createControl(Class)
public static MockClassControl createControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs, java.lang.reflect.Method[] mockedMethods)
createControl(Class, Method[])
public static MockClassControl createStrictControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs)
createStrictControl(Class)
public static MockClassControl createStrictControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs, java.lang.reflect.Method[] mockedMethods)
createStrictControl(Class, Method[])
public static MockClassControl createNiceControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs)
createNiceControl(Class)
public static MockClassControl createNiceControl(java.lang.Class classToMock, java.lang.Class[] constructorTypes, java.lang.Object[] constructorArgs, java.lang.reflect.Method[] mockedMethods)
createNiceControl(Class, Method[])