|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.test.context.support.AbstractContextLoader
ch.elca.el4j.tests.core.ModuleTestContextLoader
public class ModuleTestContextLoader
Application context loader for tests with the module application context.
| Nested Class Summary | |
|---|---|
private class |
ModuleTestContextLoader.TernaryBoolean
Helper class. |
| Field Summary | |
|---|---|
private static org.slf4j.Logger |
s_logger
Private logger. |
private static ThreadLocal<Class<?>> |
s_testedClass
Set by EL4JJunit4ClassRunner upon instanciation of the test class. |
| Constructor Summary | |
|---|---|
ModuleTestContextLoader()
|
|
| Method Summary | |
|---|---|
private ModuleApplicationContextConfiguration |
createModuleApplicationContextConfiguration()
Finds @ExtendedContextConfiguration annotations along the inheritance
graph of the test class and aggregates the information into an instance of
ModuleApplicationsContextConfiguration. |
protected void |
customizeModuleApplicationContextConfiguration(ModuleApplicationContextConfiguration config)
Interception method to customize the configuration of the module application context, before the module application context will be created. |
void |
finishRefresh(ModuleApplicationContext context)
|
String |
getResourceSuffix()
Returns " -context.xml". |
ConfigurableApplicationContext |
loadContext(String... locations)
Loads a ModuleApplicationContext from the supplied locations
using the ModuleApplicationContextConfiguration created in
createModuleApplicationContextConfiguration. |
void |
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
|
private void |
recursivelyConfigure(Class<?> annotatedClass,
ModuleApplicationContextConfiguration config)
recusively walks through the inheritance tree and applies attributes from the @ExtendedContextConfiguration annotations most-specific-last. |
static void |
setTestedClass(Class<?> testClass)
|
| Methods inherited from class org.springframework.test.context.support.AbstractContextLoader |
|---|
generateDefaultLocations, isGenerateDefaultLocations, modifyLocations, processLocations |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.slf4j.Logger s_logger
private static ThreadLocal<Class<?>> s_testedClass
EL4JJunit4ClassRunner upon instanciation of the test class.
Needed to discover @ExtendedContextConfiguration annotations which
influence the configuration of the ModuleApplicationContext to be loaded.
| Constructor Detail |
|---|
public ModuleTestContextLoader()
| Method Detail |
|---|
public ConfigurableApplicationContext loadContext(String... locations)
throws Exception
locations
using the ModuleApplicationContextConfiguration created in
createModuleApplicationContextConfiguration.
loadContext in interface ContextLoaderException
private ModuleApplicationContextConfiguration createModuleApplicationContextConfiguration()
throws IllegalStateException
@ExtendedContextConfiguration annotations along the inheritance
graph of the test class and aggregates the information into an instance of
ModuleApplicationsContextConfiguration.
IllegalStateException - if the tested class or a superclass of it is annotated
with a @ExtendedContextConfiguration but none of its transitive
superclasses are annotated with a @ContextConfiguration.
private void recursivelyConfigure(Class<?> annotatedClass,
ModuleApplicationContextConfiguration config)
@ExtendedContextConfiguration annotations most-specific-last.
annotatedClass - the class whose annotations should get inspectedconfig - the ModuleApplicationContextConfiguration to modifyprotected void customizeModuleApplicationContextConfiguration(ModuleApplicationContextConfiguration config)
config - Is the module application context configuration.public String getResourceSuffix()
-context.xml".
getResourceSuffix in class AbstractContextLoaderpublic void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
postProcessBeanFactory in interface ModuleApplicationContextCreationListenerpublic void finishRefresh(ModuleApplicationContext context)
finishRefresh in interface ModuleApplicationContextCreationListenerpublic static void setTestedClass(Class<?> testClass)
testClass - the test class which is annotated with @ConfigurationContext
and possibly @ExtendedConfigurationContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||