类 AbstractTestExecutionListener
- java.lang.Object
- org.springframework.test.context.support.AbstractTestExecutionListener
- 所有已实现的接口:
Ordered
,TestExecutionListener
- 直接已知子类:
AbstractDirtiesContextTestExecutionListener
,DependencyInjectionTestExecutionListener
,EventPublishingTestExecutionListener
,ServletTestExecutionListener
,SqlScriptsTestExecutionListener
,TransactionalTestExecutionListener
public abstract class AbstractTestExecutionListener extends Object implements TestExecutionListener, Ordered
Abstract ordered implementation of theTestExecutionListener
API.- 从以下版本开始:
- 2.5
- 作者:
- Sam Brannen, Juergen Hoeller
- 另请参阅:
getOrder()
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 AbstractTestExecutionListener()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 returnsOrdered.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.
构造器详细资料
AbstractTestExecutionListener
public AbstractTestExecutionListener()
方法详细资料
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.- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 从以下版本开始:
- 4.1
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
beforeTestClass
public void beforeTestClass(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
beforeTestClass
在接口中TestExecutionListener
- 参数:
testContext
- the test context for the test; nevernull
- 抛出:
Exception
- allows any exception to propagate- 从以下版本开始:
- 3.0
prepareTestInstance
public void prepareTestInstance(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
prepareTestInstance
在接口中TestExecutionListener
- 参数:
testContext
- the test context for the test; nevernull
- 抛出:
Exception
- allows any exception to propagate
beforeTestMethod
public void beforeTestMethod(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
beforeTestMethod
在接口中TestExecutionListener
- 参数:
testContext
- the test context in which the test method will be executed; nevernull
- 抛出:
Exception
- allows any exception to propagate- 另请参阅:
TestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
,TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)
,TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)
beforeTestExecution
public void beforeTestExecution(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
beforeTestExecution
在接口中TestExecutionListener
- 参数:
testContext
- the test context in which the test method will be executed; nevernull
- 抛出:
Exception
- allows any exception to propagate- 从以下版本开始:
- 5.2
- 另请参阅:
TestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
,TestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
,TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)
afterTestExecution
public void afterTestExecution(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
afterTestExecution
在接口中TestExecutionListener
- 参数:
testContext
- the test context in which the test method will be executed; nevernull
- 抛出:
Exception
- allows any exception to propagate- 从以下版本开始:
- 5.2
- 另请参阅:
TestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
,TestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
,TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)
afterTestMethod
public void afterTestMethod(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
afterTestMethod
在接口中TestExecutionListener
- 参数:
testContext
- the test context in which the test method was executed; nevernull
- 抛出:
Exception
- allows any exception to propagate- 另请参阅:
TestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
,TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)
,TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)
afterTestClass
public void afterTestClass(TestContext testContext) throws Exception
The default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
afterTestClass
在接口中TestExecutionListener
- 参数:
testContext
- the test context for the test; nevernull
- 抛出:
Exception
- allows any exception to propagate- 从以下版本开始:
- 3.0