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.
Ahead-of-time (AOT) support for the Spring TestContext Framework.
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 mergedConfig, 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 mergedConfig) Determine if the application context for the suppliedMergedContextConfiguration
has been loaded (i.e., is present in theContextCache
).CacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedConfig) Load the application context for the suppliedMergedContextConfiguration
by delegating to theContextLoader
configured in the givenMergedContextConfiguration
.SmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Load a newApplicationContext
based on the suppliedMergedContextConfiguration
, configure the context, and return 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.aot
Modifier and TypeMethodDescriptionAotContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) Load a newApplicationContext
for AOT build-time processing based on the suppliedMergedContextConfiguration
, configure the context, and return the context.AotContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) Load a newApplicationContext
for AOT run-time execution based on the suppliedMergedContextConfiguration
andApplicationContextInitializer
. -
Uses of MergedContextConfiguration in org.springframework.test.context.cache
Modifier and TypeMethodDescriptionvoid
DefaultCacheAwareContextLoaderDelegate.closeContext
(MergedContextConfiguration mergedConfig, 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.default int
ContextCache.getFailureCount
(MergedContextConfiguration key) Get the failure count for the given key.int
DefaultContextCache.getFailureCount
(MergedContextConfiguration key) Get the failure count for the given key.default void
ContextCache.incrementFailureCount
(MergedContextConfiguration key) Increment the failure count for the given key.void
DefaultContextCache.incrementFailureCount
(MergedContextConfiguration key) Increment the failure count for the given key.boolean
DefaultCacheAwareContextLoaderDelegate.isContextLoaded
(MergedContextConfiguration mergedConfig) DefaultCacheAwareContextLoaderDelegate.loadContext
(MergedContextConfiguration mergedConfig) protected ApplicationContext
DefaultCacheAwareContextLoaderDelegate.loadContextInternal
(MergedContextConfiguration mergedConfig) 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
.final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Delegates to an appropriate candidateSmartContextLoader
to load anApplicationContext
.final ApplicationContext
AbstractGenericContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Load aGenericApplicationContext
for the suppliedMergedContextConfiguration
.final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) Delegates to an appropriate candidateSmartContextLoader
to load anApplicationContext
for AOT processing.AbstractGenericContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) Load aGenericApplicationContext
for AOT build-time processing based on the suppliedMergedContextConfiguration
.final ApplicationContext
AbstractDelegatingSmartContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) Delegates to an appropriate candidateSmartContextLoader
to load anApplicationContext
for AOT run-time execution.AbstractGenericContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) Load aGenericApplicationContext
for AOT run-time execution based on the suppliedMergedContextConfiguration
andApplicationContextInitializer
.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
GenericXmlContextLoader.validateMergedContextConfiguration
(MergedContextConfiguration mergedConfig) Ensure that the suppliedMergedContextConfiguration
does not containclasses
.ModifierConstructorDescriptionDefaultTestContext
(Class<?> testClass, MergedContextConfiguration mergedConfig, 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 and enclosing classes via@ContextConfiguration
,@WebAppConfiguration
,@ActiveProfiles
, and@TestPropertySource
.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 TypeMethodDescriptionfinal ApplicationContext
AbstractGenericWebContextLoader.loadContext
(MergedContextConfiguration mergedConfig) Load aGenericWebApplicationContext
for the suppliedMergedContextConfiguration
.AbstractGenericWebContextLoader.loadContextForAotProcessing
(MergedContextConfiguration mergedConfig) Load aGenericWebApplicationContext
for AOT build-time processing based on the suppliedMergedContextConfiguration
.AbstractGenericWebContextLoader.loadContextForAotRuntime
(MergedContextConfiguration mergedConfig, ApplicationContextInitializer<ConfigurableApplicationContext> initializer) Load aGenericWebApplicationContext
for AOT run-time execution based on the suppliedMergedContextConfiguration
andApplicationContextInitializer
.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
.