java.lang.Object | ||
↳ | org.springframework.test.context.support.AbstractTestExecutionListener | |
↳ | org.springframework.test.context.support.DependencyInjectionTestExecutionListener |
TestExecutionListener
which provides support for dependency
injection and initialization of test instances.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
REINJECT_DEPENDENCIES_ATTRIBUTE | Attribute name for a TestContext attribute which indicates
whether or not the dependencies of a test instance should be
reinjected in
beforeTestMethod() . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If the
REINJECT_DEPENDENCIES_ATTRIBUTE in the supplied
test context has a value of TRUE ,
this method will have the same effect as
prepareTestInstance() ;
otherwise, this method will have no effect. | |||||||||||
Performs dependency injection on the
test instance of the supplied
test context by
autowiring
and
initializing
the test instance via its own
application context (without
checking dependencies). |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Performs dependency injection and bean initialization for the supplied
TestContext as described in
prepareTestInstance() . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.test.context.support.AbstractTestExecutionListener
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.test.context.TestExecutionListener
|
Attribute name for a TestContext
attribute which indicates
whether or not the dependencies of a test instance should be
reinjected in
beforeTestMethod()
. Note that
dependencies will be injected in
prepareTestInstance()
in any
case.
Clients of a TestContext
(e.g., other
TestExecutionListeners
)
may therefore choose to set this attribute to signal that dependencies
should be reinjected between execution of individual test
methods.
If the REINJECT_DEPENDENCIES_ATTRIBUTE
in the supplied
test context
has a value of TRUE
,
this method will have the same effect as
prepareTestInstance()
;
otherwise, this method will have no effect.
testContext | the test context in which the test method will be
executed; never null |
---|
Exception |
---|
Performs dependency injection on the
test instance
of the supplied
test context
by
autowiring
and
initializing
the test instance via its own
application context
(without
checking dependencies).
The REINJECT_DEPENDENCIES_ATTRIBUTE
will be subsequently removed
from the test context, regardless of its value.
testContext | the test context for the test; never null |
---|
Exception |
---|
Performs dependency injection and bean initialization for the supplied
TestContext
as described in
prepareTestInstance()
.
The REINJECT_DEPENDENCIES_ATTRIBUTE
will be subsequently removed
from the test context, regardless of its value.
testContext | the test context for which dependency injection should
be performed (never null ) |
---|
Exception | allows any exception to propagate |
---|