Package org.apache.servicemix.components.util

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


    }
   
    public void testMarshalerNamespaces() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("org/apache/servicemix/components/http/soap-response.xml"));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
View Full Code Here


        ep.setWsdl(new ClassPathResource("HelloWorld-DOC.wsdl"));
        ep.setTargetService(new QName("urn:test", "target"));
        comp.setEndpoints(new CxfBcEndpointType[] {ep});
        jbi.activateComponent(comp, "servicemix-cxfbc");

        MockServiceComponent echo = new MockServiceComponent();
        echo.setService(new QName("urn:test", "target"));
        echo.setEndpoint("endpoint");
        echo.setResponseXml(
                "<jbi:message xmlns:jbi='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
                + "<jbi:part><HelloResponse xmlns='uri:HelloWorld'><text>hello</text></HelloResponse></jbi:part></jbi:message>"
        );
        jbi.activateComponent(echo, "echo");
View Full Code Here

        ep.setWsdl(new ClassPathResource("HelloWorld-DOC.wsdl"));
        ep.setTargetService(new QName("urn:test", "target"));
        comp.setEndpoints(new CxfBcEndpointType[] {ep});
        jbi.activateComponent(comp, "servicemix-cxfbc");

        MockServiceComponent echo = new MockServiceComponent();
        echo.setService(new QName("urn:test", "target"));
        echo.setEndpoint("endpoint");
        echo.setResponseXml("<jbi:message xmlns:jbi='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'><jbi:part>"
                + "<ns2:HelloResponse xmlns:ns2='uri:HelloWorld'><text>helloffang</text></ns2:HelloResponse></jbi:part></jbi:message>");
        jbi.activateComponent(echo, "echo");
        URL wsdl = getClass().getResource("/HelloWorld-DOC.wsdl");
        assertNotNull(wsdl);
        GetMethod getMethod = new GetMethod("http://localhost:8080");
View Full Code Here

        ep.setWsdl(new ClassPathResource("HelloWorld-DOC.wsdl"));
        ep.setTargetService(new QName("urn:test", "target"));
        comp.setEndpoints(new CxfBcEndpointType[] {ep});
        jbi.activateComponent(comp, "servicemix-cxfbc");

        MockServiceComponent echo = new MockServiceComponent();
        echo.setService(new QName("urn:test", "target"));
        echo.setEndpoint("endpoint");
        echo.setResponseXml("<jbi:message xmlns:jbi='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'><jbi:part>"
                + "<ns2:HelloResponse xmlns:ns2='uri:HelloWorld'><text>helloffang</text></ns2:HelloResponse></jbi:part></jbi:message>");
        jbi.activateComponent(echo, "echo");

        URL wsdl = getClass().getResource("/HelloWorld-DOC.wsdl");
        assertNotNull(wsdl);
View Full Code Here

        ep.setWsdl(new ClassPathResource("HelloWorld-RPC.wsdl"));
        ep.setTargetService(new QName("urn:test", "target"));
        comp.setEndpoints(new CxfBcEndpointType[] {ep});
        jbi.activateComponent(comp, "servicemix-cxfbc");

        MockServiceComponent echo = new MockServiceComponent();
        echo.setService(new QName("urn:test", "target"));
        echo.setEndpoint("endpoint");
        echo.setResponseXml("<jbi:message xmlns:jbi='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
                + "<jbi:part><text>hello</text></jbi:part></jbi:message>");
        jbi.activateComponent(echo, "echo");

        URLConnection connection = new URL("http://localhost:8080/hello")
                .openConnection();
View Full Code Here

   
    public void testDeploy() throws Exception {
        ScaComponent component = new ScaComponent();
        container.activateComponent(component, "JSR181Component");

        MockServiceComponent mock = new MockServiceComponent();
        mock.setService(new QName("http://www.quickstockquote.com", "StockQuoteService"));
        mock.setEndpoint("StockQuoteServiceJBI");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        StockQuoteResponse r = new StockQuoteResponse();
        r.setResult(8.23f);
        JAXBContext.newInstance(StockQuoteResponse.class).createMarshaller().marshal(r, baos);
        mock.setResponseXml(baos.toString());
        ActivationSpec as = new ActivationSpec();
        as.setComponent(mock);
        container.activateComponent(as);
       
        // Start container
View Full Code Here

        as.setDestinationService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("soap-response.xml", getClass()));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);

        URLConnection connection = new URL("http://localhost:" + PORT_1).openConnection();
View Full Code Here

    }
   
    public void testMarshalerNamespaces() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("org/apache/servicemix/components/http/soap-response.xml"));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
View Full Code Here

        as.setDestinationService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("soap-response.xml", getClass()));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);

        URLConnection connection = new URL("http://localhost:" + PORT_1).openConnection();
View Full Code Here

    }
   
    public void testMarshalerNamespaces() throws Exception {
        ActivationSpec as = new ActivationSpec();
        as.setId("mock");
        MockServiceComponent mock = new MockServiceComponent();
        mock.setResponseResource(new ClassPathResource("org/apache/servicemix/components/http/soap-response.xml"));
        as.setComponent(mock);
        as.setService(new QName("mock"));
        container.activateComponent(as);
       
        as = new ActivationSpec();
View Full Code Here

TOP

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

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.