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
public class GenericXmlWebContextLoader extends AbstractGenericWebContextLoader
Concrete implementation ofAbstractGenericWebContextLoader
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:
GenericGroovyXmlWebContextLoader
,AnnotationConfigWebContextLoader
Field Summary
Fields inherited from class org.springframework.test.context.web.AbstractGenericWebContextLoader
logger
Constructor Summary
Constructors Constructor Description GenericXmlWebContextLoader()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getResourceSuffix()
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 Detail
GenericXmlWebContextLoader
public GenericXmlWebContextLoader()
Method Detail
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:
AbstractGenericWebContextLoader.loadBeanDefinitions(org.springframework.web.context.support.GenericWebApplicationContext, org.springframework.test.context.web.WebMergedContextConfiguration)
getResourceSuffix
protected String 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:
AbstractContextLoader.generateDefaultLocations(Class)
,AbstractContextLoader.getResourceSuffixes()
validateMergedContextConfiguration
protected void validateMergedContextConfiguration(WebMergedContextConfiguration webMergedConfig)
Ensure that the suppliedWebMergedContextConfiguration
does not containclasses
.- Overrides:
validateMergedContextConfiguration
in classAbstractGenericWebContextLoader
- Parameters:
webMergedConfig
- the merged configuration to validate- Since:
- 4.0.4
- See Also:
AbstractGenericWebContextLoader.validateMergedContextConfiguration(org.springframework.test.context.web.WebMergedContextConfiguration)