Package org.apache.servicemix.components.util

Examples of org.apache.servicemix.components.util.EchoComponent


    }
   
    public void testWithAttachments() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("echo");
        as.setComponent(new EchoComponent());
        as.setService(new QName("echo"));
        container.activateComponent(as);
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT, true));
View Full Code Here


   
    public void testInOut() throws Exception {
        int PORT = 7012;
        ActivationSpec as = new ActivationSpec();
        as.setId("echo");
        as.setComponent(new EchoComponent());
        as.setService(new QName("echo"));
        container.activateComponent(as);
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT, true));
View Full Code Here

    }
   
    public void testWithAttachments() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("echo");
        as.setComponent(new EchoComponent());
        as.setService(new QName("echo"));
        container.activateComponent(as);
        as = new ActivationSpec();
        as.setId("xfireBinding");
        as.setComponent(new HttpSoapConnector(null, PORT, true));
View Full Code Here

    }

    public void testComponent() throws Exception {
        ObjectName[] names = context.getPojoComponents();
        assertEquals(1, names.length);
        EchoComponent echo = new EchoComponent();
        container.activateComponent(echo, "echo");
        names = context.getPojoComponents();
        assertNotNull(names);
        assertEquals(2, names.length);
        assertEquals(LifeCycleMBean.STARTED, echo.getCurrentState());
        context.stopComponent("echo");
        assertEquals(LifeCycleMBean.STOPPED, echo.getCurrentState());
    }
View Full Code Here

    }
   
    public void testClientFactory() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("echo");
        as.setComponent(new EchoComponent());
        as.setService(new QName("echo"));
        jbi.activateComponent(as);
       
        JndiObjectFactoryBean fb = new JndiObjectFactoryBean();
        fb.setJndiName(ClientFactory.DEFAULT_JNDI_NAME);
View Full Code Here

    public void test() throws JBIException {
        TestListener listener = new TestListener();
        container.addListener(listener);

        EchoComponent echo = new EchoComponent(new QName("echo"), "endpoint");
        container.activateComponent(echo, "echo");

        ServiceMixClient c = container.getClientFactory().createClient();
        InOut me = c.createInOutExchange();
        me.getInMessage().setContent(new StringSource("<hello/>"));
View Full Code Here

        JBIContainer container = new JBIContainer();
        container.setEmbedded(true);
        container.init();
        container.start();
       
        EchoComponent component = new EchoComponent();
        component.setService(new QName("http://foo.bar.com", "myService"));
        container.activateComponent(component, "component");
        ServiceEndpoint ep = component.getContext().activateEndpoint(new QName("http://foo.bar.com", "myService"), "myEndpoint");
        DocumentFragment epr = ep.getAsReference(null);
        ServiceEndpoint ep2 = component.getContext().resolveEndpointReference(epr);
        assertSame(ep, ep2);
    }
View Full Code Here

        JBIContainer container = new JBIContainer();
        container.setEmbedded(true);
        container.init();
        container.start();
       
        EchoComponent component = new EchoComponent();
        component.setService(new QName("http://foo.bar.com", "myService"));
        container.activateComponent(component, "component");
        ServiceEndpoint ep = component.getContext().activateEndpoint(new QName("http://foo.bar.com", "myService"), "myEndpoint");
        DocumentFragment epr = URIResolver.createWSAEPR("endpoint:http://foo.bar.com/myService/myEndpoint");
        ServiceEndpoint ep2 = component.getContext().resolveEndpointReference(epr);
        assertSame(ep, ep2);
    }
View Full Code Here

        ep.setEndpoint("endpoint");
        ep.setBeanType(ConsumerBean.class);
        bc.setEndpoints(new BeanEndpoint[] { ep });
        jbi.activateComponent(bc, "servicemix-bean");
       
        EchoComponent echo1 = new EchoComponent(new QName("urn", "service1"), "endpoint");
        jbi.activateComponent(echo1, "echo1");
       
        EchoComponent echo2 = new EchoComponent(new QName("urn", "service2"), "endpoint");
        jbi.activateComponent(echo2, "echo2");

        jbi.start();

        ServiceMixClient client = new DefaultServiceMixClient(jbi);
View Full Code Here

    }
   
    public void testComponent() throws Exception {
      ObjectName[] names = context.getPojoComponents();
      assertEquals(1, names.length);
      EchoComponent echo = new EchoComponent();
      container.activateComponent(echo, "echo");
      names = context.getPojoComponents();
      assertNotNull(names);
      assertEquals(2, names.length);
      assertEquals(LifeCycleMBean.STARTED, echo.getCurrentState());
      context.stopComponent("echo");
      assertEquals(LifeCycleMBean.STOPPED, echo.getCurrentState());
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.components.util.EchoComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.