Class GenericGroovyXmlContextLoader
- java.lang.Object
- org.springframework.test.context.support.AbstractContextLoader
- org.springframework.test.context.support.AbstractGenericContextLoader
- org.springframework.test.context.support.GenericXmlContextLoader
- org.springframework.test.context.support.GenericGroovyXmlContextLoader
- All Implemented Interfaces:
ContextLoader,SmartContextLoader
public class GenericGroovyXmlContextLoader extends GenericXmlContextLoader
Concrete implementation ofAbstractGenericContextLoaderthat reads bean definitions from Groovy scripts and XML configuration files.Default resource locations are detected using the suffixes
"-context.xml"and"Context.groovy".- Since:
- 4.1
- Author:
- Sam Brannen
- See Also:
GroovyBeanDefinitionReader,GenericXmlContextLoader,AnnotationConfigContextLoader
Field Summary
Fields inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
logger
Constructor Summary
Constructors Constructor Description GenericGroovyXmlContextLoader()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetResourceSuffix()GenericGroovyXmlContextLoadersupports both Groovy and XML resource types for detection of defaults.protected String[]getResourceSuffixes()Returns"-context.xml" and "Context.groovy"in order to support detection of a default XML config file or Groovy script.protected voidloadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig)Load bean definitions into the suppliedcontextfrom the locations in the suppliedMergedContextConfigurationusing aGroovyBeanDefinitionReader.Methods inherited from class org.springframework.test.context.support.GenericXmlContextLoader
createBeanDefinitionReader, validateMergedContextConfiguration
Methods inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
customizeBeanFactory, customizeContext, loadContext, loadContext, prepareContext
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
customizeContext, generateDefaultLocations, isGenerateDefaultLocations, modifyLocations, prepareContext, processContextConfiguration, processLocations
Constructor Detail
GenericGroovyXmlContextLoader
public GenericGroovyXmlContextLoader()
Method Detail
loadBeanDefinitions
protected void loadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig)
Load bean definitions into the suppliedcontextfrom the locations in the suppliedMergedContextConfigurationusing aGroovyBeanDefinitionReader.- Overrides:
loadBeanDefinitionsin classAbstractGenericContextLoader- Parameters:
context- the context into which the bean definitions should be loadedmergedConfig- the merged context configuration- See Also:
AbstractGenericContextLoader.loadBeanDefinitions(org.springframework.context.support.GenericApplicationContext, org.springframework.test.context.MergedContextConfiguration)
getResourceSuffixes
protected String[] getResourceSuffixes()
Returns"-context.xml" and "Context.groovy"in order to support detection of a default XML config file or Groovy script.- Overrides:
getResourceSuffixesin classAbstractContextLoader- Returns:
- the resource suffixes; never
nullor empty - See Also:
AbstractContextLoader.generateDefaultLocations(Class)
getResourceSuffix
protected String getResourceSuffix()
GenericGroovyXmlContextLoadersupports both Groovy and XML resource types for detection of defaults. Consequently, this method is not supported.- Overrides:
getResourceSuffixin classGenericXmlContextLoader- Returns:
- the resource suffix; never
nullor empty - Throws:
UnsupportedOperationException- in this implementation- See Also:
getResourceSuffixes()