Class AbstractTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
- All Implemented Interfaces:
Ordered,TestExecutionListener
- Direct Known Subclasses:
AbstractDirtiesContextTestExecutionListener,ApplicationEventsTestExecutionListener,DependencyInjectionTestExecutionListener,EventPublishingTestExecutionListener,ServletTestExecutionListener,SqlScriptsTestExecutionListener,TransactionalTestExecutionListener
public abstract class AbstractTestExecutionListener
extends Object
implements TestExecutionListener, Ordered
Abstract ordered implementation of the
TestExecutionListener API.- Since:
- 2.5
- Author:
- Sam Brannen, Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterTestClass(TestContext testContext) The default implementation is empty.voidafterTestExecution(TestContext testContext) The default implementation is empty.voidafterTestMethod(TestContext testContext) The default implementation is empty.voidbeforeTestClass(TestContext testContext) The default implementation is empty.voidbeforeTestExecution(TestContext testContext) The default implementation is empty.voidbeforeTestMethod(TestContext testContext) The default implementation is empty.intgetOrder()The default implementation returnsOrdered.LOWEST_PRECEDENCE, thereby ensuring that custom listeners are ordered after default listeners supplied by the framework.voidprepareTestInstance(TestContext testContext) The default implementation is empty.
-
Constructor Details
-
AbstractTestExecutionListener
public AbstractTestExecutionListener()
-
-
Method Details
-
getOrder
public int getOrder()The default implementation returnsOrdered.LOWEST_PRECEDENCE, thereby ensuring that custom listeners are ordered after default listeners supplied by the framework. Can be overridden by subclasses as necessary. -
beforeTestClass
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
beforeTestClassin interfaceTestExecutionListener- Parameters:
testContext- the test context for the test; nevernull- Throws:
Exception- allows any exception to propagate- Since:
- 3.0
-
prepareTestInstance
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
prepareTestInstancein interfaceTestExecutionListener- Parameters:
testContext- the test context for the test; nevernull- Throws:
Exception- allows any exception to propagate
-
beforeTestMethod
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
beforeTestMethodin interfaceTestExecutionListener- Parameters:
testContext- the test context in which the test method will be executed; nevernull- Throws:
Exception- allows any exception to propagate- See Also:
-
beforeTestExecution
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
beforeTestExecutionin interfaceTestExecutionListener- Parameters:
testContext- the test context in which the test method will be executed; nevernull- Throws:
Exception- allows any exception to propagate- Since:
- 5.2
- See Also:
-
afterTestExecution
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
afterTestExecutionin interfaceTestExecutionListener- Parameters:
testContext- the test context in which the test method will be executed; nevernull- Throws:
Exception- allows any exception to propagate- Since:
- 5.2
- See Also:
-
afterTestMethod
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
afterTestMethodin interfaceTestExecutionListener- Parameters:
testContext- the test context in which the test method was executed; nevernull- Throws:
Exception- allows any exception to propagate- See Also:
-
afterTestClass
The default implementation is empty. Can be overridden by subclasses as necessary.- Specified by:
afterTestClassin interfaceTestExecutionListener- Parameters:
testContext- the test context for the test; nevernull- Throws:
Exception- allows any exception to propagate- Since:
- 3.0
-