Package org.unitils.inject
Class InjectModule.InjectTestListener
- java.lang.Object
-
- org.unitils.core.TestListener
-
- org.unitils.inject.InjectModule.InjectTestListener
-
- Enclosing class:
- InjectModule
protected class InjectModule.InjectTestListener extends TestListener
TheTestListenerfor this module
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedInjectTestListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterTestMethod(Object testObject, Method testMethod, Throwable throwable)After test execution, if requested restore all values that were replaced in the static injection.voidbeforeTestMethod(Object testObject, Method testMethod)Before executing a test method (i.e. after the fixture methods), the injection is performed, since objects to inject or targets are possibly instantiated during the fixture.-
Methods inherited from class org.unitils.core.TestListener
afterCreateTestObject, afterTestTearDown, beforeTestClass, beforeTestSetUp, shouldInvokeTestMethod
-
-
-
-
Method Detail
-
beforeTestMethod
public void beforeTestMethod(Object testObject, Method testMethod)
Before executing a test method (i.e. after the fixture methods), the injection is performed, since objects to inject or targets are possibly instantiated during the fixture.- Overrides:
beforeTestMethodin classTestListener- Parameters:
testObject- The test object, not nulltestMethod- The test method, not null
-
afterTestMethod
public void afterTestMethod(Object testObject, Method testMethod, Throwable throwable)
After test execution, if requested restore all values that were replaced in the static injection.- Overrides:
afterTestMethodin classTestListener- Parameters:
testObject- The test object, not nulltestMethod- The test method, not nullthrowable- The throwable thrown during the test, null if none was thrown
-
-