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 ofAbstractGenericContextLoaderthat 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 BeanDefinitionReadercreateBeanDefinitionReader(GenericApplicationContext context)Create a newXmlBeanDefinitionReader.protected StringgetResourceSuffix()Returns"-context.xml"in order to support detection of a default XML config file.protected voidvalidateMergedContextConfiguration(MergedContextConfiguration mergedConfig)Ensure that the suppliedMergedContextConfigurationdoes 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:
createBeanDefinitionReaderin classAbstractGenericContextLoader- Parameters:
context- the context for which theBeanDefinitionReadershould 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:
getResourceSuffixin classAbstractContextLoader- Returns:
- the resource suffix; never
nullor empty - See Also:
AbstractContextLoader.generateDefaultLocations(Class),AbstractContextLoader.getResourceSuffixes()
validateMergedContextConfiguration
protected void validateMergedContextConfiguration(MergedContextConfiguration mergedConfig)
Ensure that the suppliedMergedContextConfigurationdoes not containclasses.- Overrides:
validateMergedContextConfigurationin classAbstractGenericContextLoader- Parameters:
mergedConfig- the merged configuration to validate- Since:
- 4.0.4
- See Also:
AbstractGenericContextLoader.validateMergedContextConfiguration(org.springframework.test.context.MergedContextConfiguration)