1 17 package org.apache.servicemix.jbi.framework; 18 19 import javax.jbi.component.Component; 20 21 import junit.framework.TestCase; 22 23 import org.apache.servicemix.jbi.container.JBIContainer; 24 import org.apache.servicemix.tck.SenderComponent; 25 26 public class ComponentRegistryTest extends TestCase { 27 28 public void testRegister() throws Exception { 29 JBIContainer container = new JBIContainer(); 30 container.setEmbedded(true); 31 container.setUseMBeanServer(false); 32 container.init(); 33 ComponentRegistry reg = new ComponentRegistry(container.getRegistry()); 34 Component component = new SenderComponent(); 35 ComponentMBeanImpl con = reg.registerComponent( 36 new ComponentNameSpace("container", "name"), 37 "description", 38 component, 39 false, 40 false, 41 null); 42 assertNotNull(con); 43 assertEquals(con, reg.getComponent(new ComponentNameSpace("container", "name"))); 44 assertEquals(component, reg.getComponent(new ComponentNameSpace("container", "name")).getComponent()); 45 assertEquals(1, reg.getComponents().size()); 46 } 47 48 } 49 | Popular Tags |