public class BaseUnit4Test extends Object
BaseUnitTest
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 4 Version of BaseUnitTest class.BaseUnitTest
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_APP_ROOT
Key used in the context for defining the application root
|
static String |
CONTAINER_ECM |
static String |
CONTAINER_YAAFI |
static String |
containerType
Pick the default container to be Yaafi
|
static int |
defaultLogLevel
Use INFO for ConsoleLogger
|
Constructor and Description |
---|
BaseUnit4Test()
Constructor for test.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getConfigurationFileName()
Gets the configuration file name for the container should use for this test.
|
protected String |
getParameterFileName()
Gets the parameter file name for the container should use for this test.
|
protected String |
getRoleFileName()
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 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.
|
void |
tearDown()
Clean up after each test is run.
|
public static final String CONTAINER_ECM
public static final String CONTAINER_YAAFI
public static String COMPONENT_APP_ROOT
public static String containerType
public static int defaultLogLevel
public BaseUnit4Test()
testName
- name of the test being executedprotected void setConfigurationFileName(String configurationFileName)
configurationFileName
- protected void setRoleFileName(String roleFileName)
roleFileName
- protected void setLogLevel(int logLevel)
public void tearDown()
protected String getConfigurationFileName()
protected String getRoleFileName()
protected String getParameterFileName()
protected Object lookup(String roleName) throws org.apache.avalon.framework.component.ComponentException
roleName
- Name of the role the component fills.org.apache.avalon.framework.component.ComponentException
- generic exceptionprotected void release(Object component)
component
- Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.