Class GenericXmlContextLoader
- java.lang.Object
- org.springframework.test.context.support.AbstractContextLoader
- org.springframework.test.context.support.AbstractGenericContextLoader
- org.springframework.test.context.support.GenericXmlContextLoader
- All Implemented Interfaces:
ContextLoader
,SmartContextLoader
- Direct Known Subclasses:
GenericGroovyXmlContextLoader
public class GenericXmlContextLoader extends AbstractGenericContextLoader
Concrete implementation ofAbstractGenericContextLoader
that reads bean definitions from XML resources.Default resource locations are detected using the suffix
"-context.xml"
.- Since:
- 2.5
- Author:
- Sam Brannen
- See Also:
XmlBeanDefinitionReader
,GenericGroovyXmlContextLoader
,AnnotationConfigContextLoader
Field Summary
Fields inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
logger
Constructor Summary
Constructors Constructor Description GenericXmlContextLoader()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanDefinitionReader
createBeanDefinitionReader(GenericApplicationContext context)
Create a newXmlBeanDefinitionReader
.protected String
getResourceSuffix()
Returns"-context.xml"
in order to support detection of a default XML config file.protected void
validateMergedContextConfiguration(MergedContextConfiguration mergedConfig)
Ensure that the suppliedMergedContextConfiguration
does not containclasses
.Methods inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
customizeBeanFactory, customizeContext, loadBeanDefinitions, loadContext, loadContext, prepareContext
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
customizeContext, generateDefaultLocations, getResourceSuffixes, isGenerateDefaultLocations, modifyLocations, prepareContext, processContextConfiguration, processLocations
Constructor Detail
GenericXmlContextLoader
public GenericXmlContextLoader()
Method Detail
createBeanDefinitionReader
protected BeanDefinitionReader createBeanDefinitionReader(GenericApplicationContext context)
Create a newXmlBeanDefinitionReader
.- Specified by:
createBeanDefinitionReader
in classAbstractGenericContextLoader
- Parameters:
context
- the context for which theBeanDefinitionReader
should be created- Returns:
- a new
XmlBeanDefinitionReader
- See Also:
AbstractGenericContextLoader.loadContext(String...)
,AbstractGenericContextLoader.loadBeanDefinitions(org.springframework.context.support.GenericApplicationContext, org.springframework.test.context.MergedContextConfiguration)
,BeanDefinitionReader
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(MergedContextConfiguration mergedConfig)
Ensure that the suppliedMergedContextConfiguration
does not containclasses
.- Overrides:
validateMergedContextConfiguration
in classAbstractGenericContextLoader
- Parameters:
mergedConfig
- the merged configuration to validate- Since:
- 4.0.4
- See Also:
AbstractGenericContextLoader.validateMergedContextConfiguration(org.springframework.test.context.MergedContextConfiguration)