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 |
---|---|
Map<String,Object> |
attributes
Hash map to store attributes for the test
|
static String |
COMPONENT_APP_ROOT
Key used in the context for defining the application root
|
static String |
CONTAINER_ECM |
static String |
CONTAINER_YAAFI |
static int |
defaultLogLevel
Use INFO for ConsoleLogger
|
int |
maxInactiveInterval
set the Max inactive interval
|
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.
|
String |
getContainerType() |
protected HttpServletRequest |
getMockRequest()
Get a mock requestion
|
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.
|
void |
setContainerType(String containerType) |
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 final String COMPONENT_APP_ROOT
public static final int defaultLogLevel
public int maxInactiveInterval
protected void setConfigurationFileName(String configurationFileName)
configurationFileName
- the location of the config fileprotected void setRoleFileName(String roleFileName)
roleFileName
- location of the role fileprotected void setLogLevel(int logLevel)
logLevel
- set valid logging levelfor debugging levels
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
- component to be releasedprotected HttpServletRequest getMockRequest()
public String getContainerType()
public void setContainerType(String containerType)
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.