org.easymock.classextension
Class MockClassControl

java.lang.Object
  extended by org.easymock.MockControl
      extended by org.easymock.classextension.MockClassControl

public class MockClassControl
extends org.easymock.MockControl

Instances of MockClassControl control the behavior of their associated mock objects. For more information, see the EasyMock documentation.

See Also:
EasyMock

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)
          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.
 
Methods inherited from class org.easymock.MockControl
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createControl

public static org.easymock.MockControl createControl(java.lang.Class classToMock)
Creates a mock control object for the specified class or interface. The MockClassControland 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.

Parameters:
classToMock - the class to mock.
Returns:
the mock control (which is a MockClassControlinstance)

createControl

public 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. All the other methods won't be. It means that if these methods are called, their real code will be executed.

Parameters:
classToMock - the class to mock
mockedMethods - Methods to be mocked. If null, all methods will be mocked.
Returns:
the mock control

createStrictControl

public static org.easymock.MockControl createStrictControl(java.lang.Class classToMock)
Creates a mock control object for the specified class or interface. The MockClassControland 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.
Returns:
the mock control (which is a MockClassControlinstance)

createStrictControl

public 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. All the other methods won't be. It means that if these methods are called, their real code will be executed.

Parameters:
classToMock - the class to mock
mockedMethods - Methods to be mocked. If null, all methods will be mocked.
Returns:
the mock control

createNiceControl

public static org.easymock.MockControl createNiceControl(java.lang.Class classToMock)
Creates a mock control object for the specified class or interface. The MockClassControland 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).

Parameters:
classToMock - the class to mock.
Returns:
the mock control (which is a MockClassControlinstance)

createNiceControl

public 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. All the other methods won't be. It means that if these methods are called, their real code will be executed.

Parameters:
classToMock - the class to mock
mockedMethods - Methods to be mocked. If null, all methods will be mocked.
Returns:
the mock control

createControl

public 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)


createControl

public 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[])


createStrictControl

public 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)


createStrictControl

public 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[])


createNiceControl

public 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)


createNiceControl

public 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[])