| java.lang.Object org.ddsteps.mock.MockUtils
MockUtils | public class MockUtils (Code) | | Utilities for working with EasyMock.
author: Adam Skogman |
createAbstractStrictClassControl | public static MockControl createAbstractStrictClassControl(Class clazz)(Code) | | Creates a class mock, mocking all abstract methods and unimplemented inferface methods. Useful when you want to
test an abstract class that calls abstract methods or methods in an interface that are not implemented.
Parameters: clazz - The class MockControl, not null. |
createFocusedStrictClassControl | public static MockControl createFocusedStrictClassControl(Class clazz)(Code) | | Creates a class mock, mocking all methods in super classes and any remaining unimplemented abstract/interface
methods. Please note that (@link Object#equals(java.lang.Object)), (@link Object#toString()) and (@link
Object#hashCode()) will never be mocked, as we are using EasyMock. If you have overriden these, the override will
not be mocked either. If your overriden method calls any other method (which may be mocked) you need to handle
that!
Parameters: clazz - Not null |
getBean | public static MockUtilsBean getBean()(Code) | | You may use this, if you want to use the implementation rather than stick to these static methods.
Returns the implementation bean. |
replay | public static int replay(Object testCase)(Code) | | Replays all MockControls in a TestCase. Finds all fields (private even) and calls them.
Parameters: testCase - The object to browse for MockControls. The number of MockControls handled. |
setBean | public static void setBean(MockUtilsBean bean)(Code) | | Sets the implementing bean.
Parameters: bean - The bean. |
verify | public static int verify(Object testCase)(Code) | | Verifies all MockControls in a TestCase. Finds all fields (private even) and calls them.
Parameters: testCase - The object to browse for MockControls. The number of MockControls handled. |
|
|