|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.spring.profile.ProfileModule
public class ProfileModule
ProfileModule - Since Spring 3 their is the ability to use a profile.
But without Unitils you still need to do some configuration.
This module configures the Spring profile and reload the SpringApplicationContext.
| Constructor Summary | |
|---|---|
ProfileModule()
|
|
| Method Summary | |
|---|---|
void |
afterInit()
|
protected boolean |
checkIfEverythingIsInPlace(Class<?> testClass)
This method checks if the testclass contains a SpringApplicationContext and a ConfigureProfile. |
protected void |
closeContext()
The context will be closed. |
protected org.springframework.context.support.GenericApplicationContext |
getCtx()
|
protected void |
getProfile(Class<?> testClass)
First it will look if the ConfigureProfile is present. |
TestListener |
getTestListener()
|
void |
init(Properties configuration)
|
boolean |
injectBeans(Object testObject)
The injection of beans doesn't happen automatically anymore when you use SpringBeanByName or SpringBeanByType |
protected void |
setConfigurationAsTypeConfiguration(org.springframework.context.annotation.AnnotationConfigApplicationContext ctx,
ConfigureProfile profile)
How to do the configuration when you use Configuration |
protected void |
setConfigurationAsTypeSpringApplicationContext(org.springframework.context.support.GenericXmlApplicationContext ctx,
ConfigureProfile profile,
String[] placeContext)
|
protected void |
setCtx(org.springframework.context.support.GenericApplicationContext ctx)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProfileModule()
| Method Detail |
|---|
public void init(Properties configuration)
init in interface ModuleModule.init(java.util.Properties)public void afterInit()
afterInit in interface ModuleModule.afterInit()protected void getProfile(Class<?> testClass)
ConfigureProfile is present. This
annotation contains the profilename.
The Profile is set active and all the beans will be loaded.
testClass -
protected void setConfigurationAsTypeConfiguration(org.springframework.context.annotation.AnnotationConfigApplicationContext ctx,
ConfigureProfile profile)
Configuration
ctx - profile -
protected void setConfigurationAsTypeSpringApplicationContext(org.springframework.context.support.GenericXmlApplicationContext ctx,
ConfigureProfile profile,
String[] placeContext)
public boolean injectBeans(Object testObject)
SpringBeanByName or SpringBeanByType
testObject - protected boolean checkIfEverythingIsInPlace(Class<?> testClass)
SpringApplicationContext and a ConfigureProfile.
testClass -
protected void setCtx(org.springframework.context.support.GenericApplicationContext ctx)
ctx - the ctx to setprotected org.springframework.context.support.GenericApplicationContext getCtx()
protected void closeContext()
public TestListener getTestListener()
getTestListener in interface ModuleModule.getTestListener()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||