Uses of Interface
org.springframework.test.context.ContextLoader
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 classes for the Spring TestContext Framework.
Web support classes for the Spring TestContext Framework.
-
Uses of ContextLoader in org.springframework.test.context
Modifier and TypeInterfaceDescriptioninterface
Strategy interface for loading anapplication context
for an integration test managed by the Spring TestContext Framework.Modifier and TypeMethodDescriptionMergedContextConfiguration.getContextLoader()
Get the resolvedContextLoader
for the test class.Modifier and TypeMethodDescriptionClass<? extends ContextLoader>
ContextConfigurationAttributes.getContextLoaderClass()
Get theContextLoader
class that was declared via@ContextConfiguration
.Modifier and TypeMethodDescriptionprotected static String
MergedContextConfiguration.nullSafeClassName
(ContextLoader contextLoader) Generate a null-safeString
representation of the suppliedContextLoader
based solely on the fully qualified name of the loader or "null" if the supplied loader isnull
.ModifierConstructorDescriptionMergedContextConfiguration
(Class<?> testClass, String[] locations, Class<?>[] classes, String[] activeProfiles, ContextLoader contextLoader) 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, 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) 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. -
Uses of ContextLoader in org.springframework.test.context.support
Modifier and TypeClassDescriptionclass
Abstract application context loader that provides a basis for all concrete implementations of theContextLoader
SPI.class
AbstractDelegatingSmartContextLoader
serves as an abstract base class for implementations of theSmartContextLoader
SPI that delegate to a set of candidate SmartContextLoaders (i.e., one that supports XML configuration files or Groovy scripts and one that supports annotated classes) to determine which context loader is appropriate for a given test class's configuration.class
Abstract, generic extension ofAbstractContextLoader
that loads aGenericApplicationContext
.class
Concrete implementation ofAbstractGenericContextLoader
that loads bean definitions from component classes.class
DelegatingSmartContextLoader
is a concrete implementation ofAbstractDelegatingSmartContextLoader
that delegates to aGenericXmlContextLoader
(or aGenericGroovyXmlContextLoader
if Groovy is present in the classpath) and anAnnotationConfigContextLoader
.class
Concrete implementation ofAbstractGenericContextLoader
that reads bean definitions from Groovy scripts and XML configuration files.class
Deprecated.as of 5.3, in favor of Spring's common bean definition formats and/or custom loader implementationsclass
Concrete implementation ofAbstractGenericContextLoader
that reads bean definitions from XML resources.Modifier and TypeMethodDescriptionprotected ContextLoader
AbstractTestContextBootstrapper.resolveContextLoader
(Class<?> testClass, List<ContextConfigurationAttributes> configAttributesList) Resolve theContextLoader
class to use for the supplied list ofContextConfigurationAttributes
and then instantiate and return thatContextLoader
.Modifier and TypeMethodDescriptionprotected abstract Class<? extends ContextLoader>
AbstractTestContextBootstrapper.getDefaultContextLoaderClass
(Class<?> testClass) Determine the defaultContextLoader
class to use for the supplied test class.protected Class<? extends ContextLoader>
DefaultTestContextBootstrapper.getDefaultContextLoaderClass
(Class<?> testClass) ReturnsDelegatingSmartContextLoader
.protected Class<? extends ContextLoader>
AbstractTestContextBootstrapper.resolveExplicitContextLoaderClass
(List<ContextConfigurationAttributes> configAttributesList) -
Uses of ContextLoader in org.springframework.test.context.web
Modifier and TypeClassDescriptionclass
Abstract, generic extension ofAbstractContextLoader
that loads aGenericWebApplicationContext
.class
Concrete implementation ofAbstractGenericWebContextLoader
that loads bean definitions from annotated classes.class
Concrete implementation ofAbstractGenericWebContextLoader
that loads bean definitions from Groovy scripts and XML configuration files.class
Concrete implementation ofAbstractGenericWebContextLoader
that loads bean definitions from XML resources.class
WebDelegatingSmartContextLoader
is a concrete implementation ofAbstractDelegatingSmartContextLoader
that delegates to aGenericXmlWebContextLoader
(or aGenericGroovyXmlWebContextLoader
if Groovy is present on the classpath) and anAnnotationConfigWebContextLoader
.Modifier and TypeMethodDescriptionprotected Class<? extends ContextLoader>
WebTestContextBootstrapper.getDefaultContextLoaderClass
(Class<?> testClass) ReturnsWebDelegatingSmartContextLoader
if the supplied class is annotated with@WebAppConfiguration
and otherwise delegates to the superclass.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.