Package org.springframework.test.context.web

# Class GenericGroovyXmlWebContextLoader

java.lang.Object
org.springframework.test.context.support.AbstractContextLoader
org.springframework.test.context.web.AbstractGenericWebContextLoader
org.springframework.test.context.web.GenericXmlWebContextLoader
org.springframework.test.context.web.GenericGroovyXmlWebContextLoader

All Implemented Interfaces:
  `AotContextLoader`, `ContextLoader`, `SmartContextLoader`

public class GenericGroovyXmlWebContextLoader extends GenericXmlWebContextLoader
Concrete implementation of `AbstractGenericWebContextLoader` that loads 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`
  - `GenericXmlWebContextLoader`
  - `AnnotationConfigWebContextLoader`

## Field Summary

### Fields inherited from class org.springframework.test.context.web.AbstractGenericWebContextLoader

`logger`

## Constructor Summary

Constructors
Constructor
Description
`GenericGroovyXmlWebContextLoader()`

## Method Summary

Modifier and Type
Method
Description
`protected String`
`getResourceSuffix()`
`GenericGroovyXmlWebContextLoader` supports 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 void`
`loadBeanDefinitions(org.springframework.web.context.support.GenericWebApplicationContext context, WebMergedContextConfiguration webMergedConfig)`
Load bean definitions into the supplied `context` from the locations in the supplied `WebMergedContextConfiguration` using a `GroovyBeanDefinitionReader`.

### Methods inherited from class org.springframework.test.context.web.GenericXmlWebContextLoader

`validateMergedContextConfiguration`

### Methods inherited from class org.springframework.test.context.web.AbstractGenericWebContextLoader

`configureWebResources, createContext, customizeBeanFactory, customizeContext, loadContext, loadContext, loadContextForAotProcessing, loadContextForAotProcessing, loadContextForAotRuntime`

### 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

### GenericGroovyXmlWebContextLoader

public GenericGroovyXmlWebContextLoader()

## Method Details

### loadBeanDefinitions

protected void loadBeanDefinitions(org.springframework.web.context.support.GenericWebApplicationContext context, WebMergedContextConfiguration webMergedConfig)
Load bean definitions into the supplied `context` from the locations in the supplied `WebMergedContextConfiguration` using a `GroovyBeanDefinitionReader`.

Overrides:
  `loadBeanDefinitions` in class `GenericXmlWebContextLoader`
Parameters:
  `context` - the context into which the bean definitions should be loaded
  `webMergedConfig` - the merged context configuration
See Also:
  - `AbstractGenericWebContextLoader.loadBeanDefinitions(org.springframework.web.context.support.GenericWebApplicationContext, org.springframework.test.context.web.WebMergedContextConfiguration)`

### 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:
  `getResourceSuffixes` in class `AbstractContextLoader`
Returns:
  the resource suffixes; never `null` or empty
See Also:
  - `AbstractContextLoader.generateDefaultLocations(Class)`

### getResourceSuffix

protected String getResourceSuffix()
`GenericGroovyXmlWebContextLoader` supports both Groovy and XML resource types for detection of defaults. Consequently, this method is not supported.

Overrides:
  `getResourceSuffix` in class `GenericXmlWebContextLoader`
Returns:
  the resource suffix; never `null` or empty
Throws:
  `UnsupportedOperationException` - in this implementation
See Also:
  - `getResourceSuffixes()`