1 15 package org.apache.hivemind.impl; 16 17 import hivemind.test.FrameworkTestCase; 18 19 import org.apache.commons.logging.LogFactory; 20 import org.apache.hivemind.definition.ConfigurationPointDefinition; 21 import org.apache.hivemind.definition.RegistryDefinition; 22 import org.apache.hivemind.definition.impl.ModuleDefinitionImpl; 23 import org.apache.hivemind.definition.impl.RegistryDefinitionImpl; 24 import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl; 25 import org.apache.hivemind.internal.ConfigurationPoint; 26 import org.apache.hivemind.internal.RegistryInfrastructure; 27 import org.apache.hivemind.internal.ServicePoint; 28 29 35 public class TestRegistryInfrastructureConstructor extends FrameworkTestCase 36 { 37 public void testFound() 38 { 39 DefaultErrorHandler errorHandler = new DefaultErrorHandler(); 40 41 RegistryDefinition definition = new RegistryDefinitionImpl(); 42 43 ModuleDefinitionImpl fooBar = createModuleDefinition("foo.bar"); 44 45 ServicePointDefinitionImpl spd = createServicePointDefinition(fooBar, "sp1", Runnable .class); 46 47 fooBar.addServicePoint(spd); 48 49 ModuleDefinitionImpl zipZoop = createModuleDefinition("zip.zoop"); 50 51 ConfigurationPointDefinition cpd = createConfigurationPointDefinition(fooBar, "cp1"); 52 53 zipZoop.addConfigurationPoint(cpd); 54 55 definition.addModule(fooBar); 56 definition.addModule(zipZoop); 57 58 RegistryInfrastructureConstructor ric = new RegistryInfrastructureConstructor(errorHandler, 59 LogFactory.getLog(TestRegistryInfrastructureConstructor.class), null); 60 61 RegistryInfrastructure registryInfrastructure = ric.constructRegistryInfrastructure(definition); 62 63 ServicePoint sp = registryInfrastructure.getServicePoint("foo.bar.sp1", null); 64 assertNotNull(sp); 65 66 ConfigurationPoint cp = registryInfrastructure.getConfigurationPoint("zip.zoop.cp1", null); 67 assertNotNull(cp); 68 } 69 } | Popular Tags |