See: Description
Interface | Description |
---|---|
ActiveProfilesResolver |
Strategy interface for programmatically resolving which active bean
definition profiles should be used when loading an
ApplicationContext
for a test class. |
ContextLoader |
Strategy interface for loading an
application context
for an integration test managed by the Spring TestContext Framework. |
SmartContextLoader |
Strategy interface for loading an
application context
for an integration test managed by the Spring TestContext Framework. |
TestContext |
TestContext encapsulates the context in which a test is executed,
agnostic of the actual testing framework in use. |
TestExecutionListener |
TestExecutionListener defines a listener API for reacting to
test execution events published by the TestContextManager with which
the listener is registered. |
Class | Description |
---|---|
CacheAwareContextLoaderDelegate |
CacheAwareContextLoaderDelegate loads application contexts from
MergedContextConfiguration by delegating to the
ContextLoader configured in the MergedContextConfiguration
and interacting transparently with the ContextCache behind the scenes. |
ContextConfigurationAttributes |
ContextConfigurationAttributes encapsulates the context configuration
attributes declared via @ContextConfiguration . |
MergedContextConfiguration |
MergedContextConfiguration encapsulates the merged
context configuration declared on a test class and all of its superclasses
via @ContextConfiguration and
@ActiveProfiles . |
TestContextManager |
TestContextManager is the main entry point into the Spring
TestContext Framework, which provides support for loading and accessing
application contexts ,
dependency injection of test instances,
transactional
execution of test methods, etc. |
Annotation Type | Description |
---|---|
ActiveProfiles |
ActiveProfiles is a class-level annotation that is used to declare
which active bean definition profiles should be used when loading
an ApplicationContext
for test classes. |
ContextConfiguration |
@ContextConfiguration defines class-level metadata that is
used to determine how to load and configure an
ApplicationContext
for integration tests. |
ContextHierarchy |
@ContextHierarchy is a class-level annotation that is used to define
a hierarchy of ApplicationContexts for integration tests. |
TestExecutionListeners |
TestExecutionListeners defines class-level metadata for
configuring which TestExecutionListeners should
be registered with a TestContextManager . |
This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use. The same techniques and annotation-based configuration used in, for example, a JUnit 4.5+ environment can also be applied to tests written with TestNG, etc.
In addition to providing generic and extensible testing infrastructure, the Spring TestContext Framework provides out-of-the-box support for Spring-specific integration testing functionality such as context management and caching, dependency injection of test fixtures, and transactional test management with default rollback semantics.