# Uses of Interface
org.springframework.test.context.ContextLoader

Packages that use ContextLoader
Package
Description
org.springframework.test.context
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.
org.springframework.test.context.aot
Ahead-of-time (AOT) support for the Spring TestContext Framework.
org.springframework.test.context.support
Support classes for the Spring TestContext Framework.
org.springframework.test.context.web
Web support classes for the Spring TestContext Framework.

## Uses of ContextLoader in org.springframework.test.context

Subinterfaces of ContextLoader in org.springframework.test.context
Modifier and Type
Interface
Description
`interface`
`SmartContextLoader`
Strategy interface for loading an `ApplicationContext` for an integration test managed by the Spring TestContext Framework.
Methods in org.springframework.test.context that return ContextLoader
Modifier and Type
Method
Description
`ContextLoader`
MergedContextConfiguration.`getContextLoader()`
Get the resolved `ContextLoader` for the test class.
Methods in org.springframework.test.context that return types with arguments of type ContextLoader
Modifier and Type
Method
Description
`Class<? extends ContextLoader>`
ContextConfigurationAttributes.`getContextLoaderClass()`
Get the `ContextLoader` class that was declared via `@ContextConfiguration`.
Methods in org.springframework.test.context with parameters of type ContextLoader
Modifier and Type
Method
Description
`protected static String`
MergedContextConfiguration.`nullSafeClassName(ContextLoader contextLoader)`
Generate a null-safe `String` representation of the supplied `ContextLoader` based solely on the fully qualified name of the loader or "null" if the supplied loader is `null`.
Constructors in org.springframework.test.context with parameters of type ContextLoader
Modifier
Constructor
Description
``
`MergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, String[] activeProfiles, ContextLoader contextLoader)`
Create a new `MergedContextConfiguration` instance for the supplied parameters.
``
`MergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, Set<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Deprecated.
since 6.1 in favor of `MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
``
`MergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Deprecated.
since 6.1 in favor of `MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
``
`MergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, List<org.springframework.core.io.support.PropertySourceDescriptor> propertySourceDescriptors, String[] propertySourceProperties, Set<ContextCustomizer> contextCustomizers, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Create a new `MergedContextConfiguration` instance for the supplied parameters.
``
`MergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, ContextLoader contextLoader)`
Create a new `MergedContextConfiguration` instance for the supplied parameters.
``
`MergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Create a new `MergedContextConfiguration` instance for the supplied parameters.

## Uses of ContextLoader in org.springframework.test.context.aot

Subinterfaces of ContextLoader in org.springframework.test.context.aot
Modifier and Type
Interface
Description
`interface`
`AotContextLoader`
Strategy interface for loading an `ApplicationContext` for build-time AOT processing as well as run-time AOT execution for an integration test managed by the Spring TestContext Framework.

## Uses of ContextLoader in org.springframework.test.context.support

Classes in org.springframework.test.context.support that implement ContextLoader
Modifier and Type
Class
Description
`class`
`AbstractContextLoader`
Abstract application context loader that provides a basis for all concrete implementations of the `ContextLoader` SPI.
`class`
`AbstractDelegatingSmartContextLoader`
`AbstractDelegatingSmartContextLoader` serves as an abstract base class for implementations of the `SmartContextLoader` 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`
`AbstractGenericContextLoader`
Abstract, generic extension of `AbstractContextLoader` that loads a `GenericApplicationContext`.
`class`
`AnnotationConfigContextLoader`
Concrete implementation of `AbstractGenericContextLoader` that loads bean definitions from component classes.
`class`
`DelegatingSmartContextLoader`
`DelegatingSmartContextLoader` is a concrete implementation of `AbstractDelegatingSmartContextLoader` that delegates to a `GenericXmlContextLoader` (or a `GenericGroovyXmlContextLoader` if Groovy is present in the classpath) and an `AnnotationConfigContextLoader`.
`class`
`GenericGroovyXmlContextLoader`
Concrete implementation of `AbstractGenericContextLoader` that reads bean definitions from Groovy scripts and XML configuration files.
`class`
`GenericXmlContextLoader`
Concrete implementation of `AbstractGenericContextLoader` that reads bean definitions from XML resources.
Methods in org.springframework.test.context.support that return ContextLoader
Modifier and Type
Method
Description
`protected ContextLoader`
AbstractTestContextBootstrapper.`resolveContextLoader(Class<?> testClass, List<ContextConfigurationAttributes> configAttributesList)`
Resolve the `ContextLoader` class to use for the supplied list of `ContextConfigurationAttributes` and then instantiate and return that `ContextLoader`.
Methods in org.springframework.test.context.support that return types with arguments of type ContextLoader
Modifier and Type
Method
Description
`protected abstract Class<? extends ContextLoader>`
AbstractTestContextBootstrapper.`getDefaultContextLoaderClass(Class<?> testClass)`
Determine the default `ContextLoader` class to use for the supplied test class.
`protected Class<? extends ContextLoader>`
DefaultTestContextBootstrapper.`getDefaultContextLoaderClass(Class<?> testClass)`
Returns `DelegatingSmartContextLoader`.
`protected Class<? extends ContextLoader>`
AbstractTestContextBootstrapper.`resolveExplicitContextLoaderClass(List<ContextConfigurationAttributes> configAttributesList)`
Resolve the `ContextLoader` class to use for the supplied list of `ContextConfigurationAttributes`.

## Uses of ContextLoader in org.springframework.test.context.web

Classes in org.springframework.test.context.web that implement ContextLoader
Modifier and Type
Class
Description
`class`
`AbstractGenericWebContextLoader`
Abstract, generic extension of `AbstractContextLoader` that loads a `GenericWebApplicationContext`.
`class`
`AnnotationConfigWebContextLoader`
Concrete implementation of `AbstractGenericWebContextLoader` that loads bean definitions from annotated classes.
`class`
`GenericGroovyXmlWebContextLoader`
Concrete implementation of `AbstractGenericWebContextLoader` that loads bean definitions from Groovy scripts and XML configuration files.
`class`
`GenericXmlWebContextLoader`
Concrete implementation of `AbstractGenericWebContextLoader` that loads bean definitions from XML resources.
`class`
`WebDelegatingSmartContextLoader`
`WebDelegatingSmartContextLoader` is a concrete implementation of `AbstractDelegatingSmartContextLoader` that delegates to a `GenericXmlWebContextLoader` (or a `GenericGroovyXmlWebContextLoader` if Groovy is present on the classpath) and an `AnnotationConfigWebContextLoader`.
Methods in org.springframework.test.context.web that return types with arguments of type ContextLoader
Modifier and Type
Method
Description
`protected Class<? extends ContextLoader>`
WebTestContextBootstrapper.`getDefaultContextLoaderClass(Class<?> testClass)`
Returns `WebDelegatingSmartContextLoader` if the supplied class is annotated with `@WebAppConfiguration` and otherwise delegates to the superclass.
Constructors in org.springframework.test.context.web with parameters of type ContextLoader
Modifier
Constructor
Description
``
`WebMergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, String resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Deprecated.
since 6.1 in favor of `WebMergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
``
`WebMergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, String[] propertySourceLocations, String[] propertySourceProperties, Set<ContextCustomizer> contextCustomizers, String resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Deprecated.
since 6.1 in favor of `WebMergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
``
`WebMergedContextConfiguration(Class<?> testClass, String[] locations, Class<?>[] classes, Set<Class<? extends org.springframework.context.ApplicationContextInitializer<?>>> contextInitializerClasses, String[] activeProfiles, List<org.springframework.core.io.support.PropertySourceDescriptor> propertySourceDescriptors, String[] propertySourceProperties, Set<ContextCustomizer> contextCustomizers, String resourceBasePath, ContextLoader contextLoader, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate, MergedContextConfiguration parent)`
Create a new `WebMergedContextConfiguration` instance for the supplied parameters.