|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.guiceyfruit.testing.InjectorManager
public class InjectorManager
Used to manage the injectors for the various injection points
Nested Class Summary | |
---|---|
protected class |
InjectorManager.TestModule
|
Constructor Summary | |
---|---|
InjectorManager()
|
Method Summary | |
---|---|
void |
afterClasses()
Lets close all of the injectors we have created so far |
void |
afterTest(java.lang.Object test)
|
void |
beforeClasses()
|
void |
beforeTest(java.lang.Object test)
|
protected void |
closeInjectors()
|
void |
closeSingletons()
Closes down any JVM level singletons used in this testing JVM |
protected com.google.inject.Injector |
createInjector(java.lang.Class<? extends com.google.inject.Module> moduleType)
Creates the injector for the given key |
protected java.lang.Class<? extends com.google.inject.Module> |
getModuleForTestClass(java.lang.Class<?> objectType)
Factory method to return the module type that will be used to create an injector. |
boolean |
isCloseSingletonsAfterClasses()
|
void |
setCloseSingletonsAfterClasses(boolean closeSingletonsAfterClasses)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InjectorManager()
Method Detail |
---|
public void beforeClasses()
public void afterClasses() throws CloseFailedException
CloseFailedException
public void beforeTest(java.lang.Object test) throws java.lang.Exception
java.lang.Exception
public void afterTest(java.lang.Object test) throws java.lang.Exception
java.lang.Exception
public void closeSingletons() throws CloseFailedException
CloseFailedException
public boolean isCloseSingletonsAfterClasses()
public void setCloseSingletonsAfterClasses(boolean closeSingletonsAfterClasses)
protected void closeInjectors() throws CloseFailedException
CloseFailedException
protected java.lang.Class<? extends com.google.inject.Module> getModuleForTestClass(java.lang.Class<?> objectType) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.ClassNotFoundException
org.guiceyfruit.modules
(see Injectors.MODULE_CLASS_NAMES
otherwise if that is not set it will look for the UseModule
annotation and use the module defined on that otherwise it will try look for the
inner public static class "TestModule"
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
UseModule
,
NESTED_MODULE_CLASS
protected com.google.inject.Injector createInjector(java.lang.Class<? extends com.google.inject.Module> moduleType) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |