类 DirtiesContextTestExecutionListener
java.lang.Object
cn.taketoday.test.context.support.AbstractTestExecutionListener
cn.taketoday.test.context.support.AbstractDirtiesContextTestExecutionListener
cn.taketoday.test.context.support.DirtiesContextTestExecutionListener
- 所有已实现的接口:
cn.taketoday.core.Ordered,TestExecutionListener
public class DirtiesContextTestExecutionListener
extends AbstractDirtiesContextTestExecutionListener
TestExecutionListener which provides support for marking the
ApplicationContext associated with a test as dirty for
both test classes and test methods annotated with the
@DirtiesContext annotation.
This listener supports test methods with the
method mode set to
AFTER_METHOD and test classes with the
class mode set to
AFTER_EACH_TEST_METHOD or
AFTER_CLASS. For support for BEFORE
modes, see DirtiesContextBeforeModesTestExecutionListener.
When merging
TestExecutionListeners with the defaults, this listener will
automatically be ordered after the DependencyInjectionTestExecutionListener;
otherwise, this listener must be manually configured to execute after the
DependencyInjectionTestExecutionListener.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen
- 另请参阅:
-
字段概要
从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidafterTestClass(TestContext testContext) If the test class of the supplied test context is annotated with@DirtiesContextand the class mode is set toAFTER_CLASS, the application context of the test context will be marked as dirty, and theREINJECT_DEPENDENCIES_ATTRIBUTEin the test context will be set totrue.voidafterTestMethod(TestContext testContext) If the current test method of the supplied test context is annotated with@DirtiesContextand the method mode is set toAFTER_METHOD, or if the test class is annotated with@DirtiesContextand the class mode is set toAFTER_EACH_TEST_METHOD, the application context of the test context will be marked as dirty and theREINJECT_DEPENDENCIES_ATTRIBUTEin the test context will be set totrue.final intgetOrder()Returns3000.从类继承的方法 cn.taketoday.test.context.support.AbstractDirtiesContextTestExecutionListener
beforeOrAfterTestClass, beforeOrAfterTestMethod, dirtyContext从类继承的方法 cn.taketoday.test.context.support.AbstractTestExecutionListener
afterTestExecution, beforeTestClass, beforeTestExecution, beforeTestMethod, prepareTestInstance
-
构造器详细资料
-
DirtiesContextTestExecutionListener
public DirtiesContextTestExecutionListener()
-
-
方法详细资料
-
getOrder
public final int getOrder()Returns3000.- 指定者:
getOrder在接口中cn.taketoday.core.Ordered- 指定者:
getOrder在类中AbstractDirtiesContextTestExecutionListener
-
afterTestMethod
If the current test method of the supplied test context is annotated with@DirtiesContextand the method mode is set toAFTER_METHOD, or if the test class is annotated with@DirtiesContextand the class mode is set toAFTER_EACH_TEST_METHOD, the application context of the test context will be marked as dirty and theREINJECT_DEPENDENCIES_ATTRIBUTEin the test context will be set totrue.- 指定者:
afterTestMethod在接口中TestExecutionListener- 覆盖:
afterTestMethod在类中AbstractTestExecutionListener- 参数:
testContext- the test context in which the test method was executed; nevernull- 抛出:
Exception- allows any exception to propagate- 另请参阅:
-
afterTestClass
If the test class of the supplied test context is annotated with@DirtiesContextand the class mode is set toAFTER_CLASS, the application context of the test context will be marked as dirty, and theREINJECT_DEPENDENCIES_ATTRIBUTEin the test context will be set totrue.- 指定者:
afterTestClass在接口中TestExecutionListener- 覆盖:
afterTestClass在类中AbstractTestExecutionListener- 参数:
testContext- the test context for the test; nevernull- 抛出:
Exception- allows any exception to propagate
-