类 DirtiesContextBeforeModesTestExecutionListener
java.lang.Object
cn.taketoday.test.context.support.AbstractTestExecutionListener
cn.taketoday.test.context.support.AbstractDirtiesContextTestExecutionListener
cn.taketoday.test.context.support.DirtiesContextBeforeModesTestExecutionListener
- 所有已实现的接口:
cn.taketoday.core.Ordered,TestExecutionListener
public class DirtiesContextBeforeModesTestExecutionListener
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
BEFORE_METHOD and test classes with the
class mode set to
BEFORE_EACH_TEST_METHOD or
BEFORE_CLASS. For support for AFTER
modes, see DirtiesContextTestExecutionListener.
When merging
TestExecutionListeners with the defaults, this listener will
automatically be ordered before the DependencyInjectionTestExecutionListener;
otherwise, this listener must be manually configured to execute before the
DependencyInjectionTestExecutionListener.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen
- 另请参阅:
-
字段概要
从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidbeforeTestClass(TestContext testContext) If the test class of the supplied test context is annotated with@DirtiesContextand the class mode is set toBEFORE_CLASS, the application context of the test context will be marked as dirty, and theREINJECT_DEPENDENCIES_ATTRIBUTEin the test context will be set totrue.voidbeforeTestMethod(TestContext testContext) If the current test method of the supplied test context is annotated with@DirtiesContextand the method mode is set toBEFORE_METHOD, or if the test class is annotated with@DirtiesContextand the class mode is set toBEFORE_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()Returns1500.从类继承的方法 cn.taketoday.test.context.support.AbstractDirtiesContextTestExecutionListener
beforeOrAfterTestClass, beforeOrAfterTestMethod, dirtyContext从类继承的方法 cn.taketoday.test.context.support.AbstractTestExecutionListener
afterTestClass, afterTestExecution, afterTestMethod, beforeTestExecution, prepareTestInstance
-
构造器详细资料
-
DirtiesContextBeforeModesTestExecutionListener
public DirtiesContextBeforeModesTestExecutionListener()
-
-
方法详细资料
-
getOrder
public final int getOrder()Returns1500.- 指定者:
getOrder在接口中cn.taketoday.core.Ordered- 指定者:
getOrder在类中AbstractDirtiesContextTestExecutionListener
-
beforeTestClass
If the test class of the supplied test context is annotated with@DirtiesContextand the class mode is set toBEFORE_CLASS, the application context of the test context will be marked as dirty, and theREINJECT_DEPENDENCIES_ATTRIBUTEin the test context will be set totrue.- 指定者:
beforeTestClass在接口中TestExecutionListener- 覆盖:
beforeTestClass在类中AbstractTestExecutionListener- 参数:
testContext- the test context for the test; nevernull- 抛出:
Exception- allows any exception to propagate
-
beforeTestMethod
If the current test method of the supplied test context is annotated with@DirtiesContextand the method mode is set toBEFORE_METHOD, or if the test class is annotated with@DirtiesContextand the class mode is set toBEFORE_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.- 指定者:
beforeTestMethod在接口中TestExecutionListener- 覆盖:
beforeTestMethod在类中AbstractTestExecutionListener- 参数:
testContext- the test context in which the test method will be executed; nevernull- 抛出:
Exception- allows any exception to propagate- 另请参阅:
-