类 ApplicationEventsTestExecutionListener
java.lang.Object
cn.taketoday.test.context.support.AbstractTestExecutionListener
cn.taketoday.test.context.event.ApplicationEventsTestExecutionListener
- 所有已实现的接口:
cn.taketoday.core.Ordered,TestExecutionListener
TestExecutionListener which provides support for ApplicationEvents.
This listener manages the registration of ApplicationEvents for the
current thread at various points within the test execution lifecycle and makes
the current instance of ApplicationEvents available to tests via an
@Autowired
field in the test class.
If the test class is not annotated or meta-annotated with
@RecordApplicationEvents, this listener
effectively does nothing.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private static classFactory that exposes the currentApplicationEventsobject on demand. -
字段概要
字段修饰符和类型字段说明private static final Objectprivate static final StringAttribute name for aTestContextattribute which indicates whether the test class for the given test context is annotated with@RecordApplicationEvents.从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidafterTestMethod(TestContext testContext) The default implementation is empty.voidbeforeTestMethod(TestContext testContext) The default implementation is empty.final intgetOrder()Returns1800.voidprepareTestInstance(TestContext testContext) The default implementation is empty.private booleanrecordApplicationEvents(TestContext testContext) private voidregisterListenerAndResolvableDependencyIfNecessary(cn.taketoday.context.ApplicationContext applicationContext) 从类继承的方法 cn.taketoday.test.context.support.AbstractTestExecutionListener
afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution
-
字段详细资料
-
RECORD_APPLICATION_EVENTS
Attribute name for aTestContextattribute which indicates whether the test class for the given test context is annotated with@RecordApplicationEvents.Permissible values include
Boolean.TRUEandBoolean.FALSE. -
applicationEventsMonitor
-
-
构造器详细资料
-
ApplicationEventsTestExecutionListener
public ApplicationEventsTestExecutionListener()
-
-
方法详细资料
-
getOrder
public final int getOrder()Returns1800.- 指定者:
getOrder在接口中cn.taketoday.core.Ordered- 覆盖:
getOrder在类中AbstractTestExecutionListener
-
prepareTestInstance
从类复制的说明:AbstractTestExecutionListenerThe default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
prepareTestInstance在接口中TestExecutionListener- 覆盖:
prepareTestInstance在类中AbstractTestExecutionListener- 参数:
testContext- the test context for the test; nevernull- 抛出:
Exception- allows any exception to propagate
-
beforeTestMethod
从类复制的说明:AbstractTestExecutionListenerThe default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
beforeTestMethod在接口中TestExecutionListener- 覆盖:
beforeTestMethod在类中AbstractTestExecutionListener- 参数:
testContext- the test context in which the test method will be executed; nevernull- 抛出:
Exception- allows any exception to propagate- 另请参阅:
-
afterTestMethod
从类复制的说明:AbstractTestExecutionListenerThe default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
afterTestMethod在接口中TestExecutionListener- 覆盖:
afterTestMethod在类中AbstractTestExecutionListener- 参数:
testContext- the test context in which the test method was executed; nevernull- 抛出:
Exception- allows any exception to propagate- 另请参阅:
-
recordApplicationEvents
-
registerListenerAndResolvableDependencyIfNecessary
private void registerListenerAndResolvableDependencyIfNecessary(cn.taketoday.context.ApplicationContext applicationContext)
-