1 17 package org.apache.servicemix.jbi.framework; 18 19 import javax.jbi.servicedesc.ServiceEndpoint; 20 import javax.xml.namespace.QName ; 21 22 import junit.framework.TestCase; 23 24 import org.apache.servicemix.components.util.EchoComponent; 25 import org.apache.servicemix.jbi.container.ActivationSpec; 26 import org.apache.servicemix.jbi.container.JBIContainer; 27 import org.w3c.dom.DocumentFragment ; 28 29 public class RegistryTest extends TestCase { 30 31 public void testResolveEPR() throws Exception { 32 JBIContainer container = new JBIContainer(); 33 container.setEmbedded(true); 34 container.init(); 35 container.start(); 36 37 EchoComponent component = new EchoComponent(); 38 container.activateComponent(component, "component"); 39 ServiceEndpoint ep = component.getContext().activateEndpoint(new QName ("http://foo.bar.com", "myService"), "myEndpoint"); 40 DocumentFragment epr = ep.getAsReference(null); 41 ServiceEndpoint ep2 = component.getContext().resolveEndpointReference(epr); 42 assertSame(ep, ep2); 43 44 } 45 46 } 47 | Popular Tags |