java.lang.Object | ||
↳ | org.springframework.test.context.support.AbstractTestExecutionListener | |
↳ | org.springframework.test.context.support.DirtiesContextTestExecutionListener |
TestExecutionListener
which provides support for marking the
ApplicationContext
associated with a test as dirty for
both test classes and test methods configured with the @DirtiesContext
annotation.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If the test class of the supplied
test context is
annotated with @DirtiesContext , the
application context of the test context will
be marked as dirty ,
and the
REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to
true . | |||||||||||
If the current test method of the supplied
test
context is annotated with @DirtiesContext ,
or if the test class is annotated with @DirtiesContext and the DirtiesContext#classMode() class
mode is set to AFTER_EACH_TEST_METHOD , the application
context of the test context will be
marked as dirty and the
REINJECT_DEPENDENCIES_ATTRIBUTE in the test context will be set to
true . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Marks the
application context of the supplied
test context as
dirty , and sets the
REINJECT_DEPENDENCIES_ATTRIBUTE in the test context to true
. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.context.support.AbstractTestExecutionListener
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.test.context.TestExecutionListener
|
If the test class of the supplied test context
is
annotated with @DirtiesContext
, the
application context
of the test context will
be marked as dirty
,
and the
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set to
true
.
testContext | the test context for the test; never null |
---|
Exception |
---|
If the current test method of the supplied test
context
is annotated with @DirtiesContext
,
or if the test class is annotated with @DirtiesContext
and the DirtiesContext#classMode() class
mode is set to AFTER_EACH_TEST_METHOD
, the application
context
of the test context will be
marked as dirty
and the
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set to
true
.
testContext | the test context in which the test method was
executed; never null |
---|
Exception |
---|
Marks the application context
of the supplied
test context
as
dirty
, and sets the
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context to true
.