Package org.apache.tapestry5.test.ioc
Class MockTester
java.lang.Object
org.apache.tapestry5.test.ioc.MockTester
Deprecated.
In 5.4, with no replacement
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).
This class was originally in the tapestry-ioc module as was moved to tapestry-test; the package name was not changed
to ensure backwards compatibility.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Deprecated.Invoked after an individual unit test (i.e., a test method invocation) to discard the mock control.org.easymock.IMocksControl
Deprecated.<T> T
Deprecated.Creates a new mock object of the indicated type.void
replay()
Deprecated.Switches each mock object created bynewMock(Class)
into replay mode (out of the initial training mode).void
verify()
Deprecated.Verifies that all trained methods have been invoked on all mock objects (created bynewMock(Class)
, then switches each mock object back to training mode.
-
Constructor Details
-
MockTester
public MockTester()Deprecated.
-
-
Method Details
-
cleanup
Deprecated.Invoked after an individual unit test (i.e., a test method invocation) to discard the mock control. -
getMocksControl
Deprecated. -
newMock
Deprecated.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.- Type Parameters:
T
- the type of the mock object- Parameters:
mockClass
- the class to mock- Returns:
- the mock object, ready for training
-
replay
Deprecated.Switches each mock object created bynewMock(Class)
into replay mode (out of the initial training mode). -
verify
Deprecated.Verifies that all trained methods have been invoked on all mock objects (created bynewMock(Class)
, then switches each mock object back to training mode.
-