Klasse BaseUnitTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.fulcrum.testcontainer.BaseUnitTest
Alle implementierten Schnittstellen:
junit.framework.Test

public class BaseUnitTest extends junit.framework.TestCase
Base class for unit tests for components. 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. This class uses JUnit 3.
Version:
$Id$
Autor:
Eric Pugh, Quinton McCombs
Siehe auch:
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final String
    Key used in the context for defining the application root
    static final String
     
    static final String
     
    static final String
    Pick the default container to be Yaafi
    static final int
    Use INFO for ConsoleLogger
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    BaseUnitTest(String testName)
    Constructor for test.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected String
    Gets the configuration file name for the container should use for this test.
    protected String
    Gets the parameter file name for the container should use for this test.
    protected String
    Gets the role file name for the container should use for this test.
    protected Object
    lookup(String roleName)
    Returns an instance of the named component.
    protected void
    release(Object component)
    Releases the component.
    protected Object
    resolve(String roleName)
    Helper method for converting to and from Merlin Unit TestCase.
    protected void
    setConfigurationFileName(String configurationFileName)
    Gets the configuration file name for the container should use for this test.
    protected void
    setLogLevel(int logLevel)
    Set the console logger level
    protected void
    setRoleFileName(String roleFileName)
    Override the role file name for the container should use for this test.
    protected void
    Clean up after each test is run.

    Von Klasse geerbte Methoden junit.framework.TestCase

    assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, toString

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Felddetails

  • Konstruktordetails

    • BaseUnitTest

      public BaseUnitTest(String testName)
      Constructor for test.
      Parameter:
      testName - name of the test being executed
  • 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
    • tearDown

      protected void tearDown()
      Clean up after each test is run.
      Setzt außer Kraft:
      tearDown in Klasse junit.framework.TestCase
    • 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
    • resolve

      protected Object resolve(String roleName) throws org.apache.avalon.framework.component.ComponentException
      Helper method for converting to and from Merlin Unit TestCase.
      Parameter:
      roleName - the role name to resolve
      Gibt zurück:
      the component matching the role
      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