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:
AotContextLoader
,ContextLoader
,SmartContextLoader
Concrete implementation of
AbstractGenericContextLoader
that 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
GenericGroovyXmlContextLoader
supports both Groovy and XML resource types for detection of defaults.protected String[]
Returns"-context.xml"
and"Context.groovy"
in order to support detection of a default XML config file or Groovy script.protected void
loadBeanDefinitions
(org.springframework.context.support.GenericApplicationContext context, MergedContextConfiguration mergedConfig) Load bean definitions into the suppliedcontext
from the locations in the suppliedMergedContextConfiguration
using aGroovyBeanDefinitionReader
.Methods inherited from class org.springframework.test.context.support.GenericXmlContextLoader
createBeanDefinitionReader, validateMergedContextConfiguration
Methods inherited from class org.springframework.test.context.support.AbstractGenericContextLoader
createContext, customizeBeanFactory, customizeContext, loadContext, loadContext, loadContextForAotProcessing, loadContextForAotRuntime, prepareContext
Methods inherited from class org.springframework.test.context.support.AbstractContextLoader
customizeContext, generateDefaultLocations, isGenerateDefaultLocations, modifyLocations, prepareContext, processContextConfiguration, processLocations
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.test.context.SmartContextLoader
processContextConfiguration, processLocations
-
Constructor Details
-
GenericGroovyXmlContextLoader
public GenericGroovyXmlContextLoader()
-
-
Method Details
-
loadBeanDefinitions
protected void loadBeanDefinitions(org.springframework.context.support.GenericApplicationContext context, MergedContextConfiguration mergedConfig) Load bean definitions into the suppliedcontext
from the locations in the suppliedMergedContextConfiguration
using aGroovyBeanDefinitionReader
.- Overrides:
loadBeanDefinitions
in classAbstractGenericContextLoader
- Parameters:
context
- the context into which the bean definitions should be loadedmergedConfig
- the merged context configuration- See Also:
-
getResourceSuffixes
Returns"-context.xml"
and"Context.groovy"
in order to support detection of a default XML config file or Groovy script.- Overrides:
getResourceSuffixes
in classAbstractContextLoader
- Returns:
- the resource suffixes; never
null
or empty - See Also:
-
getResourceSuffix
GenericGroovyXmlContextLoader
supports both Groovy and XML resource types for detection of defaults. Consequently, this method is not supported.- Overrides:
getResourceSuffix
in classGenericXmlContextLoader
- Returns:
- the resource suffix; never
null
or empty - Throws:
UnsupportedOperationException
- in this implementation- See Also:
-