| java.lang.Object org.apache.tapestry.ioc.test.MockTester
MockTester | final public class MockTester (Code) | | Contains core logic used by
TestBase , allowing for mock objects to be used outside of a
TestNG-based test suite. A single standard mock control is used for all mock
instances. The control does not care about execution order, but will balk at any unexpected
method invocations. This class is thread safe (it used a thread local to store the mock control).
|
Method Summary | |
public void | cleanup() Invoked after an individual unit test (i.e., a test method invocation) to discard the mock
control. | public IMocksControl | getMocksControl() | public T | newMock(Class<T> mockClass) Creates a new mock object of the indicated type. | public void | replay() Switches each mock object created by
MockTester.newMock(Class) into replay mode (out of the
initial training mode). | public void | verify() Verifies that all trained methods have been invoked on all mock objects (created by
MockTester.newMock(Class) , then switches each mock object back to training mode. |
cleanup | public void cleanup()(Code) | | Invoked after an individual unit test (i.e., a test method invocation) to discard the mock
control.
|
getMocksControl | public IMocksControl getMocksControl()(Code) | | |
newMock | public T newMock(Class<T> mockClass)(Code) | | Creates a new mock object of the indicated type. The shared mock control does not
check order, but does fail on any unexpected method invocations.
< Parameters: T - >the type of the mock object Parameters: mockClass - the class to mock the mock object, ready for training |
verify | public void verify()(Code) | | Verifies that all trained methods have been invoked on all mock objects (created by
MockTester.newMock(Class) , then switches each mock object back to training mode.
|
|
|