예제 #1
0
  public void testContextManager() throws Exception {
    final Context managerContext = m_manager.getContainerManagerContext();
    assertNotNull(managerContext);

    final ServiceManager serviceManager = (ServiceManager) managerContext.get(SERVICE_MANAGER);
    assertNotNull(serviceManager);

    final InstrumentManager instrumentManager =
        (InstrumentManager) serviceManager.lookup(InstrumentManager.ROLE);
    assertNotNull(instrumentManager);
    assertSame(m_instrManager, instrumentManager);
  }
예제 #2
0
  public void setUp() throws Exception {
    FortressConfig config = new FortressConfig(FortressConfig.createDefaultConfig());
    config.setContainerConfiguration("resource://org/apache/avalon/fortress/test/data/test1.xconf");
    config.setLoggerManagerConfiguration(
        "resource://org/apache/avalon/fortress/test/data/test1.xlog");

    m_instrManager = new DefaultInstrumentManagerImpl();
    ContainerUtil.enableLogging(m_instrManager, new ConsoleLogger());
    ContainerUtil.initialize(m_instrManager);
    config.setInstrumentManager(m_instrManager);

    m_manager = new ContextManager(config.getContext(), new ConsoleLogger());
    m_manager.initialize();
  }
예제 #3
0
 public void tearDown() {
   m_manager.dispose();
 }