Class GenericXmlWebContextLoader
java.lang.Object
org.springframework.test.context.support.AbstractContextLoader
org.springframework.test.context.web.AbstractGenericWebContextLoader
org.springframework.test.context.web.GenericXmlWebContextLoader
- All Implemented Interfaces:
AotContextLoader, ContextLoader, SmartContextLoader
- Direct Known Subclasses:
GenericGroovyXmlWebContextLoader
Concrete implementation of
AbstractGenericWebContextLoader
that loads
bean definitions from XML resources.
Default resource locations are detected using the suffix
"-context.xml"
.
- Since:
- 3.2
- Author:
- Sam Brannen
- See Also:
-
Field Summary
Fields inherited from class AbstractGenericWebContextLoader
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns"-context.xml"
in order to support detection of a default XML config file.protected void
loadBeanDefinitions
(GenericWebApplicationContext context, WebMergedContextConfiguration webMergedConfig) Load bean definitions into the suppliedcontext
from the locations in the suppliedWebMergedContextConfiguration
, using anXmlBeanDefinitionReader
.protected void
validateMergedContextConfiguration
(WebMergedContextConfiguration webMergedConfig) Ensure that the suppliedWebMergedContextConfiguration
does not containclasses
.Methods inherited from class AbstractGenericWebContextLoader
configureWebResources, createContext, customizeBeanFactory, customizeContext, loadContext, loadContext, loadContextForAotProcessing, loadContextForAotProcessing, loadContextForAotRuntime
Methods inherited from class AbstractContextLoader
customizeContext, generateDefaultLocations, getResourceSuffixes, isGenerateDefaultLocations, modifyLocations, prepareContext, processContextConfiguration, processLocations
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface SmartContextLoader
processContextConfiguration, processLocations
-
Constructor Details
-
GenericXmlWebContextLoader
public GenericXmlWebContextLoader()
-
-
Method Details
-
loadBeanDefinitions
protected void loadBeanDefinitions(GenericWebApplicationContext context, WebMergedContextConfiguration webMergedConfig) Load bean definitions into the suppliedcontext
from the locations in the suppliedWebMergedContextConfiguration
, using anXmlBeanDefinitionReader
.- Specified by:
loadBeanDefinitions
in classAbstractGenericWebContextLoader
- Parameters:
context
- the context into which the bean definitions should be loadedwebMergedConfig
- the merged context configuration to use to load the web application context- See Also:
-
getResourceSuffix
Returns"-context.xml"
in order to support detection of a default XML config file.- Specified by:
getResourceSuffix
in classAbstractContextLoader
- Returns:
- the resource suffix; never
null
or empty - See Also:
-
validateMergedContextConfiguration
Ensure that the suppliedWebMergedContextConfiguration
does not containclasses
.- Overrides:
validateMergedContextConfiguration
in classAbstractGenericWebContextLoader
- Parameters:
webMergedConfig
- the merged configuration to validate- Since:
- 4.0.4
- See Also:
-