类 AbstractTestExecutionListener
- java.lang.Object
- org.springframework.test.context.support.AbstractTestExecutionListener
- 所有已实现的接口:
Ordered
,TestExecutionListener
- 直接已知子类:
AbstractDirtiesContextTestExecutionListener
,DependencyInjectionTestExecutionListener
,ServletTestExecutionListener
,SqlScriptsTestExecutionListener
,TransactionalTestExecutionListener
public abstract class AbstractTestExecutionListener extends Object implements TestExecutionListener, Ordered
Abstract implementation of theTestExecutionListener
interface which provides empty method stubs. Subclasses can extend this class and override only those methods suitable for the task at hand.- 从以下版本开始:
- 2.5
- 作者:
- Sam Brannen, Juergen Hoeller
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 AbstractTestExecutionListener()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterTestClass(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
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()
方法详细资料
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
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
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
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
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