Package org.exoplatform.commons.testing
Class AbstractExoContainerTestCase
java.lang.Object
org.exoplatform.commons.testing.AbstractExoContainerTestCase
A base test class that allows to load an exo container with a selected set of
components. It is aimed at running lighter test cases than the
StandaloneContainer. Example usage :
@ConfiguredBy({@ConfigurationUnit(scope = ContainerScope.ROOT, path = "conf/custom.xml")
,@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/some.xml")
,@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/other.xml")})
- Version:
- $Revision$
- Author:
- Patrice Lamarque
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected <T,U extends T>
UgetComponent(Class<T> key) Get a component from current containerprotected <T,I extends T>
voidregisterComponent(Class<T> key, I instance) Register a component to the containerprotected <T,I extends T>
voidreplaceComponent(Class<T> key, I instance) Replace a component implementation by registering it against the current containerfinal void
-
Constructor Details
-
AbstractExoContainerTestCase
public AbstractExoContainerTestCase()
-
-
Method Details
-
startContainer
public final void startContainer() -
afterContainerStart
protected void afterContainerStart() -
beforeContainerStart
protected void beforeContainerStart() -
registerComponent
Register a component to the container- Parameters:
key- component keyinstance- component instance to register
-
getComponent
Get a component from current container- Type Parameters:
T- type of component (key)U- type of component implementation (type)- Parameters:
key- class of the registered component- Returns:
-
replaceComponent
Replace a component implementation by registering it against the current container- Parameters:
key- component keyinstance- component instance to register
-