Uses of Class
org.springframework.test.context.MergedContextConfiguration
Package
Description
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.
Support for context caching within the Spring TestContext Framework.
Support classes for the Spring TestContext Framework.
Web support classes for the Spring TestContext Framework.
-
Uses of MergedContextConfiguration in org.springframework.test.context
Modifier and TypeMethodDescriptionTestContextBootstrapper.buildMergedContextConfiguration()
Build the merged context configuration for the test class in theBootstrapContext
associated with this bootstrapper.MergedContextConfiguration.getParent()
Get theMergedContextConfiguration
for the parent application context in a context hierarchy.Modifier and TypeMethodDescriptionvoid
CacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedContextConfiguration, DirtiesContext.HierarchyMode hierarchyMode) Remove the application context for the suppliedMergedContextConfiguration
from theContextCache
and close it if it is an instance ofConfigurableApplicationContext
.void
ContextCustomizer.customizeContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Customize the suppliedConfigurableApplicationContext
after bean definitions have been loaded into the context but before the context has been refreshed.default boolean
CacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedContextConfiguration) Determine if the application context for the suppliedMergedContextConfiguration
has been loaded (i.e., is present in theContextCache
).CacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedContextConfiguration) Load the application context for the suppliedMergedContextConfiguration
by delegating to theContextLoader
configured in the givenMergedContextConfiguration
.SmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Loads a newcontext
based on the suppliedmerged context configuration
, configures the context, and finally returns the context in a fully refreshed state.ModifierConstructorDescriptionMergedContextConfiguration
(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, Set<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) Create a newMergedContextConfiguration
instance for the supplied parameters.MergedContextConfiguration
(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) Create a newMergedContextConfiguration
instance for the supplied parameters.MergedContextConfiguration
(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) Create a newMergedContextConfiguration
instance for the supplied parameters.MergedContextConfiguration
(MergedContextConfiguration mergedConfig) Create a newMergedContextConfiguration
instance by copying all fields from the suppliedMergedContextConfiguration
. -
Uses of MergedContextConfiguration in org.springframework.test.context.cache
Modifier and TypeMethodDescriptionvoid
DefaultCacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedContextConfiguration, DirtiesContext.HierarchyMode hierarchyMode) boolean
ContextCache.contains
(MergedContextConfiguration key) Determine whether there is a cached context for the given key.boolean
DefaultContextCache.contains
(MergedContextConfiguration key) Determine whether there is a cached context for the given key.ContextCache.get
(MergedContextConfiguration key) Obtain a cachedApplicationContext
for the given key.DefaultContextCache.get
(MergedContextConfiguration key) Obtain a cachedApplicationContext
for the given key.boolean
DefaultCacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedContextConfiguration) DefaultCacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedContextConfiguration) protected ApplicationContext
DefaultCacheAwareContextLoaderDelegate.loadContextInternal
(MergedContextConfiguration mergedContextConfiguration) Load theApplicationContext
for the supplied merged context configuration.void
ContextCache.put
(MergedContextConfiguration key, ApplicationContext context) Explicitly add anApplicationContext
instance to the cache under the given key, potentially honoring a custom eviction policy.void
DefaultContextCache.put
(MergedContextConfiguration key, ApplicationContext context) Explicitly add anApplicationContext
instance to the cache under the given key, potentially honoring a custom eviction policy.void
ContextCache.remove
(MergedContextConfiguration key, DirtiesContext.HierarchyMode hierarchyMode) Remove the context with the given key from the cache and explicitly close it if it is an instance ofConfigurableApplicationContext
.void
DefaultContextCache.remove
(MergedContextConfiguration key, DirtiesContext.HierarchyMode hierarchyMode) Remove the context with the given key from the cache and explicitly close it if it is an instance ofConfigurableApplicationContext
. -
Uses of MergedContextConfiguration in org.springframework.test.context.support
Modifier and TypeMethodDescriptionAbstractTestContextBootstrapper.buildMergedContextConfiguration()
Build the merged context configuration for the test class in theBootstrapContext
associated with this bootstrapper.protected MergedContextConfiguration
AbstractTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Process the supplied, newly instantiatedMergedContextConfiguration
instance.Modifier and TypeMethodDescriptionprotected void
AbstractContextLoader.customizeContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Customize theConfigurableApplicationContext
created by thisContextLoader
after bean definitions have been loaded into the context but before the context has been refreshed.protected void
AbstractGenericContextLoader.loadBeanDefinitions
(GenericApplicationContext context, MergedContextConfiguration mergedConfig) Load bean definitions into the suppliedcontext
from the locations or classes in the suppliedMergedContextConfiguration
.protected void
AnnotationConfigContextLoader.loadBeanDefinitions
(GenericApplicationContext context, MergedContextConfiguration mergedConfig) Register classes in the suppliedcontext
from the classes in the suppliedMergedContextConfiguration
.protected void
GenericGroovyXmlContextLoader.loadBeanDefinitions
(GenericApplicationContext context, MergedContextConfiguration mergedConfig) Load bean definitions into the suppliedcontext
from the locations in the suppliedMergedContextConfiguration
using aGroovyBeanDefinitionReader
.AbstractDelegatingSmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Delegates to an appropriate candidateSmartContextLoader
to load anApplicationContext
.AbstractGenericContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Load a Spring ApplicationContext from the suppliedMergedContextConfiguration
.protected void
AbstractContextLoader.prepareContext
(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) Prepare theConfigurableApplicationContext
created by thisSmartContextLoader
before bean definitions are read.protected MergedContextConfiguration
AbstractTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Process the supplied, newly instantiatedMergedContextConfiguration
instance.protected void
AbstractGenericContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Validate the suppliedMergedContextConfiguration
with respect to what this context loader supports.protected void
AnnotationConfigContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Ensure that the suppliedMergedContextConfiguration
does not containlocations
.protected void
GenericPropertiesContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Deprecated.Ensure that the suppliedMergedContextConfiguration
does not containclasses
.protected void
GenericXmlContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Ensure that the suppliedMergedContextConfiguration
does not containclasses
.ModifierConstructorDescriptionDefaultTestContext
(Class<?> testClass, MergedContextConfiguration mergedContextConfiguration, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate) Construct a newDefaultTestContext
from the supplied arguments. -
Uses of MergedContextConfiguration in org.springframework.test.context.web
Modifier and TypeClassDescriptionclass
WebMergedContextConfiguration
encapsulates the merged context configuration declared on a test class and all of its superclasses via@ContextConfiguration
,@WebAppConfiguration
, and@ActiveProfiles
.Modifier and TypeMethodDescriptionprotected MergedContextConfiguration
WebTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Returns aWebMergedContextConfiguration
if the test class in the suppliedMergedContextConfiguration
is annotated with@WebAppConfiguration
and otherwise returns the supplied instance unmodified.Modifier and TypeMethodDescriptionAbstractGenericWebContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Load a SpringWebApplicationContext
from the suppliedMergedContextConfiguration
.protected MergedContextConfiguration
WebTestContextBootstrapper.processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Returns aWebMergedContextConfiguration
if the test class in the suppliedMergedContextConfiguration
is annotated with@WebAppConfiguration
and otherwise returns the supplied instance unmodified.ModifierConstructorDescriptionWebMergedContextConfiguration
(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, String resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) Create a newWebMergedContextConfiguration
instance for the supplied parameters.WebMergedContextConfiguration
(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, Set<ContextCustomizer> contextCustomizers, String resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent) Create a newWebMergedContextConfiguration
instance for the supplied parameters.WebMergedContextConfiguration
(MergedContextConfiguration mergedConfig, String resourceBasePath) Create a newWebMergedContextConfiguration
instance by copying all properties from the suppliedMergedContextConfiguration
.