1 17 18 package org.apache.avalon.fortress.impl.role.test; 19 20 import org.apache.avalon.fortress.impl.role.ConfigurableRoleManager; 21 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder; 22 import org.apache.avalon.framework.logger.ConsoleLogger; 23 24 25 34 public class ConfigurableRoleManagerTestCase 35 extends AbstractRoleManagerTestCase 36 { 37 public ConfigurableRoleManagerTestCase( String name ) 38 { 39 super( name ); 40 } 41 42 public void testShorthandReturnValues() 43 throws Exception 44 { 45 DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(); 46 ConfigurableRoleManager roles = new ConfigurableRoleManager( null, this.getClass().getClassLoader() ); 47 roles.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_INFO ) ); 48 roles.configure( builder.build( this.getClass().getClassLoader() 49 .getResourceAsStream( "org/apache/avalon/fortress/impl/role/test/ConfigManager.roles" ) ) ); 50 51 checkRole( roles, 52 "component1", 53 "org.apache.avalon.fortress.test.data.Role1", 54 "org.apache.avalon.fortress.test.data.Component1", 55 "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" ); 56 checkRole( roles, 57 "component2", 58 "org.apache.avalon.fortress.test.data.Role2", 59 "org.apache.avalon.fortress.test.data.Component2", 60 "org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler" ); 61 checkRole( roles, 62 "component3", 63 "org.apache.avalon.fortress.test.data.Role3", 64 "org.apache.avalon.fortress.test.data.Component3", 65 "org.apache.avalon.fortress.impl.handler.PoolableComponentHandler" ); 66 } 67 } 68 69 | Popular Tags |