org.apache.avalon.fortress.testcase
Class FortressTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.avalon.fortress.testcase.FortressTestCase
All Implemented Interfaces:
junit.framework.Test

public class FortressTestCase
extends junit.framework.TestCase

JUnit TestCase for Components run under Fortress.

Version:
$Id: ExcaliburTestCase.java,v 1.6 2004/02/28 11:47:27 cziegeler Exp $
Author:
Avalon Development Team

Field Summary
private  java.lang.String m_className
           
private  org.apache.avalon.fortress.impl.DefaultContainer m_container
          The Fortress Container instance
private  org.apache.avalon.fortress.ContainerManager m_containerManager
          Reference to the container manager for use in the shutdown hook.
private  org.apache.avalon.framework.service.ServiceManager m_serviceManager
          Reference to the Service Manager.
 
Constructor Summary
FortressTestCase(java.lang.String name)
           
 
Method Summary
protected  org.apache.avalon.framework.service.ServiceManager getServiceManager()
          Returns a reference to the Fortress ServiceManager.
protected  org.apache.avalon.framework.context.Context initializeContext(org.apache.avalon.framework.context.Context context)
          Gives sublasses the oportunity to modify the Context before it is used to create the Container.
private  org.apache.avalon.framework.configuration.Configuration loadConfiguration(java.io.InputStream is)
           
private  java.io.InputStream locateConfigurationResource(java.lang.Class clazz, java.lang.String name)
           
 void setUp()
           
 void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_className

private final java.lang.String m_className

m_containerManager

private org.apache.avalon.fortress.ContainerManager m_containerManager
Reference to the container manager for use in the shutdown hook.


m_container

private org.apache.avalon.fortress.impl.DefaultContainer m_container
The Fortress Container instance


m_serviceManager

private org.apache.avalon.framework.service.ServiceManager m_serviceManager
Reference to the Service Manager.

Constructor Detail

FortressTestCase

public FortressTestCase(java.lang.String name)
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

locateConfigurationResource

private java.io.InputStream locateConfigurationResource(java.lang.Class clazz,
                                                        java.lang.String name)

loadConfiguration

private org.apache.avalon.framework.configuration.Configuration loadConfiguration(java.io.InputStream is)
                                                                           throws java.lang.Exception
Throws:
java.lang.Exception

initializeContext

protected org.apache.avalon.framework.context.Context initializeContext(org.apache.avalon.framework.context.Context context)
Gives sublasses the oportunity to modify the Context before it is used to create the Container.

The context provided will have been marked read-only. To make modifications to the context, it must first be wrapped in a new context instance as follows:

   DefaultContext newContext = new DefaultContext( context );
   newContext.put( "key", "value" );
   newContext.makeReadOnly();
   return newContext;
 
This version of the method simply returns the context instance unmodified.

Parameters:
context - The base Context object.
Returns:
The context which will be used to create the Container.

getServiceManager

protected org.apache.avalon.framework.service.ServiceManager getServiceManager()
Returns a reference to the Fortress ServiceManager.

Returns:
The ServiceManager.