Created @ParentContextConfiguration to support parent test contexts
in spring-test framework.
Parent context will be shared across the test classes if they are
annotated to use parent context and have same configurations(xml
locations, configuration classes, etc). It also uses existing context
I also added "parent" attribute to @DirtiesContext annotation in order
to close the parent context if required. When "parent=true" is set on
@DirtiesContext, DirtiesContextTestExecutionListener will close the
parent application context as well as child contexts using the specified
- created @ParentContextConfiguration to configure the parent
- reused the @ContextConfigurationAttributes to represent both
@ContextConfiguration and @ParentContextConfiguration
- changed ContextLoader SPI to pass a parent ApplicationContext
- refactored ContextLoaderUtils to use "getConfigurationAttributes()"
to resolve the context loader class and configuration attribute.
- created ContextCacheKey class which contains two
MergedContextConfiguration (one for parent, one for child) as a key
- added "parent" attribute on @DirtiesContext
- @DirtiesContext(parent=true) will remove parent app context and all
child app contexts using that parent context from the cache
- unit tests