1 17 18 package org.apache.avalon.fortress.impl.role.test; 19 20 import org.apache.avalon.fortress.impl.handler.FactoryComponentHandler; 21 import org.apache.avalon.fortress.impl.handler.PerThreadComponentHandler; 22 import org.apache.avalon.fortress.impl.handler.PoolableComponentHandler; 23 import org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler; 24 import org.apache.avalon.fortress.impl.role.ServiceMetaManager; 25 import org.apache.avalon.fortress.test.data.*; 26 import org.apache.avalon.framework.container.ContainerUtil; 27 import org.apache.avalon.framework.logger.NullLogger; 28 29 35 public class ServiceMetaManagerTestCase extends AbstractMetaInfoManagerTestCase 36 { 37 public ServiceMetaManagerTestCase( String name ) 38 { 39 super( name ); 40 } 41 42 public void setUp() throws Exception 43 { 44 m_manager = new ServiceMetaManager(); 45 ContainerUtil.enableLogging( m_manager, new NullLogger() ); 46 ContainerUtil.initialize( m_manager ); 47 } 48 49 public void testTestRoles() throws Exception 50 { 51 String [] roles = new String []{Role1.class.getName()}; 52 checkRole( "component1", roles, Component1.class.getName(), ThreadSafeComponentHandler.class.getName() ); 53 54 roles[0] = Role2.class.getName(); 55 checkRole( "component2", roles, Component2.class.getName(), PoolableComponentHandler.class.getName() ); 56 57 roles[0] = Role4.class.getName(); 58 checkRole( "component4", roles, Component4.class.getName(), FactoryComponentHandler.class.getName() ); 59 60 roles = new String [] 61 { 62 Role3.class.getName(), 63 BaseRole.class.getName() 64 }; 65 66 checkRole( "component3", roles, Component3.class.getName(), PerThreadComponentHandler.class.getName() ); 67 } 68 } 69 | Popular Tags |