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 Details

    • AbstractExoContainerTestCase

      public AbstractExoContainerTestCase()
  • Method Details

    • 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 key
      instance - 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 key
      instance - component instance to register