|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.test.context.support
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Load a Spring ApplicationContext from the supplied MergedContextConfiguration.Implementation details:
@return a new application context @see org.springframework.test.context.SmartContextLoader#loadContext(MergedContextConfiguration) @see GenericApplicationContext @since 3.1
- Creates a GenericApplicationContext instance.
- Calls .prepareContext(GenericApplicationContext) for backwards compatibility with the ContextLoader SPI.
- Calls .prepareContext(ConfigurableApplicationContext, MergedContextConfiguration) to allow for customizing the context before bean definitions are loaded.
- Calls .customizeBeanFactory(DefaultListableBeanFactory) to allow for customizing the context's
DefaultListableBeanFactory
.- Delegates to .loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration) to populate the context from the locations or classes in the supplied
MergedContextConfiguration
.- Delegates to AnnotationConfigUtils for registering annotation configuration processors.
- Calls .customizeContext(GenericApplicationContext) to allow for customizing the context before it is refreshed.
- Refreshes the context and registers a JVM shutdown hook for it.
Detect the default configuration classes for the supplied test class.The
returned class array will contain all static inner classes of the supplied class that meet the requirements for {@code @Configuration} class implementations as specified in the documentation for @Configuration. Thedefault implementationof this method adheres to the contractsimplydefined indelegates totheSmartContextLoaderAnnotationConfigContextLoaderUtils.detectDefaultConfigurationClasses(Class)SPI. Specifically, this method uses introspection to detect default configuration classes that comply with the constraints required of {@code @Configuration} class implementations. If a potential candidate configuration class does not meet these requirements, this method will log a warning, and the potential candidate class will be ignored.@param declaringClass the test class that declared {@code @ContextConfiguration} @return an array of default configuration classes, potentially empty but nevernull
@see AnnotationConfigContextLoaderUtils
{@code DelegatingSmartContextLoader} isan implementation of thea concrete implementation ofSmartContextLoaderAbstractDelegatingSmartContextLoaderSPIthat delegates toa set ofacandidate SmartContextLoaders (i.e.,GenericXmlContextLoader andAnnotationConfigContextLoader) to determine which context loader is appropriate for a given test class's configuration. Each candidate is given a chance to process the ContextConfigurationAttributes for each class in the test class hierarchy that is annotated with @ContextConfiguration, and the candidate that supports the merged, processed configuration will be used to actually load the context. Placinganempty {@code @ContextConfiguration} annotation on a test class signals that default resource locations (i.e., XML configuration files) or default configuration classes should be detected. Furthermore, if a specific ContextLoader or SmartContextLoader is not explicitly declared via {@code @ContextConfiguration}, {@code DelegatingSmartContextLoader} will be used as the default loader, thus providing automatic support for either XML configuration files or annotated classes, but not both simultaneously. As of Spring 3.2, a test class may optionally declare neither XML configuration files nor annotated classes and instead declare onlyContextConfiguration#initializers application context initializersAnnotationConfigContextLoader.In such cases, an attempt will still be made to detect defaults, but their absence will not result an an exception.@author Sam Brannen @since 3.1 @see SmartContextLoader @see AbstractDelegatingSmartContextLoader @see GenericXmlContextLoader @see AnnotationConfigContextLoader