Klasse BaseUnit5Test

java.lang.Object
org.apache.fulcrum.testcontainer.BaseUnit5Test

public class BaseUnit5Test extends Object
Alternative Base class to BaseUnit4Test for component tests. This version doesn't load the container until the first request for a component. This allows the tester to populate the configurationFileName and roleFileName, possible one per test. JUnit 5 Version of BaseUnitTest class.
Version:
$Id$
Autor:
Eric Pugh, Quinton McCombs
Siehe auch:
  • Felddetails

    • CONTAINER_ECM

      public static final String CONTAINER_ECM
      Siehe auch:
    • CONTAINER_YAAFI

      public static final String CONTAINER_YAAFI
      Siehe auch:
    • COMPONENT_APP_ROOT

      public static final String COMPONENT_APP_ROOT
      Key used in the context for defining the application root
      Siehe auch:
    • defaultLogLevel

      public static final int defaultLogLevel
      Use INFO for ConsoleLogger
      Siehe auch:
    • attributes

      public Map<String,Object> attributes
      Hash map to store attributes for the test
    • maxInactiveInterval

      public int maxInactiveInterval
      set the Max inactive interval
  • Konstruktordetails

    • BaseUnit5Test

      public BaseUnit5Test()
      Constructor for test.
  • Methodendetails

    • setConfigurationFileName

      protected void setConfigurationFileName(String configurationFileName)
      Gets the configuration file name for the container should use for this test. By default it is src/test/TestComponentConfig.
      Parameter:
      configurationFileName - the location of the config file
    • setRoleFileName

      protected void setRoleFileName(String roleFileName)
      Override the role file name for the container should use for this test. By default it is src/test/TestRoleConfig.
      Parameter:
      roleFileName - location of the role file
    • setLogLevel

      protected void setLogLevel(int logLevel)
      Set the console logger level
      Parameter:
      logLevel - set valid logging level
      Siehe auch:
      • for debugging levels
    • getLogLevel

      public int getLogLevel()
    • tearDown

      @AfterEach public void tearDown()
      Clean up after each test is run.
    • getConfigurationFileName

      protected String getConfigurationFileName()
      Gets the configuration file name for the container should use for this test.
      Gibt zurück:
      The filename of the configuration file
    • getRoleFileName

      protected String getRoleFileName()
      Gets the role file name for the container should use for this test.
      Gibt zurück:
      The filename of the role configuration file
    • getParameterFileName

      protected String getParameterFileName()
      Gets the parameter file name for the container should use for this test.
      Gibt zurück:
      The filename of the role configuration file
    • lookup

      protected Object lookup(String roleName) throws org.apache.avalon.framework.component.ComponentException
      Returns an instance of the named component. This method will also start the container if it has not been started already
      Parameter:
      roleName - Name of the role the component fills.
      Gibt zurück:
      instance of the component
      Löst aus:
      org.apache.avalon.framework.component.ComponentException - generic exception
    • release

      protected void release(Object component)
      Releases the component.
      Parameter:
      component - component to be released
    • getMockRequest

      protected HttpServletRequest getMockRequest()
      Get a mock requestion
      Gibt zurück:
      HttpServletRequest a mock servlet request
    • getContainerType

      public String getContainerType()
      Gibt zurück:
      the container type
    • setContainerType

      public void setContainerType(String containerType)
      Parameter:
      containerType - container type to set