Package org.exoplatform.commons.testing
Class AbstractExoContainerTestCase
- java.lang.Object
-
- org.exoplatform.commons.testing.AbstractExoContainerTestCase
-
public abstract class AbstractExoContainerTestCase extends Object
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 Constructor Description AbstractExoContainerTestCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterContainerStart()protected voidbeforeContainerStart()protected <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 containervoidstartContainer()
-
-
-
Method Detail
-
startContainer
public final void startContainer()
-
afterContainerStart
protected void afterContainerStart()
-
beforeContainerStart
protected void beforeContainerStart()
-
registerComponent
protected <T,I extends T> void registerComponent(Class<T> key, I instance)
Register a component to the container- Parameters:
key- component keyinstance- component instance to register
-
getComponent
protected <T,U extends T> U getComponent(Class<T> key)
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
protected <T,I extends T> void replaceComponent(Class<T> key, I instance)
Replace a component implementation by registering it against the current container- Parameters:
key- component keyinstance- component instance to register
-
-