public abstract class AbstractTestExecutionListener extends Object implements TestExecutionListener, Ordered
TestExecutionListener
API.getOrder()
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
AbstractTestExecutionListener() |
Modifier and Type | Method and Description |
---|---|
void |
afterTestClass(TestContext testContext)
The default implementation is empty.
|
void |
afterTestExecution(TestContext testContext)
The default implementation is empty.
|
void |
afterTestMethod(TestContext testContext)
The default implementation is empty.
|
void |
beforeTestClass(TestContext testContext)
The default implementation is empty.
|
void |
beforeTestExecution(TestContext testContext)
The default implementation is empty.
|
void |
beforeTestMethod(TestContext testContext)
The default implementation is empty.
|
int |
getOrder()
The default implementation returns
Ordered.LOWEST_PRECEDENCE ,
thereby ensuring that custom listeners are ordered after default
listeners supplied by the framework. |
void |
prepareTestInstance(TestContext testContext)
The default implementation is empty.
|
public int getOrder()
Ordered.LOWEST_PRECEDENCE
,
thereby ensuring that custom listeners are ordered after default
listeners supplied by the framework. Can be overridden by subclasses
as necessary.getOrder
in interface Ordered
Ordered.HIGHEST_PRECEDENCE
,
Ordered.LOWEST_PRECEDENCE
public void beforeTestClass(TestContext testContext) throws Exception
beforeTestClass
in interface TestExecutionListener
testContext
- the test context for the test; never null
Exception
- allows any exception to propagatepublic void prepareTestInstance(TestContext testContext) throws Exception
prepareTestInstance
in interface TestExecutionListener
testContext
- the test context for the test; never null
Exception
- allows any exception to propagatepublic void beforeTestMethod(TestContext testContext) throws Exception
beforeTestMethod
in interface TestExecutionListener
testContext
- the test context in which the test method will be
executed; never null
Exception
- allows any exception to propagateTestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
,
TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)
,
TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)
public void beforeTestExecution(TestContext testContext) throws Exception
beforeTestExecution
in interface TestExecutionListener
testContext
- the test context in which the test method will be
executed; never null
Exception
- allows any exception to propagateTestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
,
TestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
,
TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)
public void afterTestExecution(TestContext testContext) throws Exception
afterTestExecution
in interface TestExecutionListener
testContext
- the test context in which the test method will be
executed; never null
Exception
- allows any exception to propagateTestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
,
TestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
,
TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)
public void afterTestMethod(TestContext testContext) throws Exception
afterTestMethod
in interface TestExecutionListener
testContext
- the test context in which the test method was
executed; never null
Exception
- allows any exception to propagateTestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
,
TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)
,
TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)
public void afterTestClass(TestContext testContext) throws Exception
afterTestClass
in interface TestExecutionListener
testContext
- the test context for the test; never null
Exception
- allows any exception to propagate