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:
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 org.springframework.test.context.web.AbstractGenericWebContextLoader
logger
-
Constructor Summary
-
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 org.springframework.test.context.web.AbstractGenericWebContextLoader
configureWebResources, customizeBeanFactory, customizeContext, loadContext, loadContext
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
customizeContext, generateDefaultLocations, getResourceSuffixes, isGenerateDefaultLocations, modifyLocations, prepareContext, 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:
-