Package org.apache.camel

Examples of org.apache.camel.StringSource


    }
   
    @Converter
    public StreamSource toStreamSourceFromDOM(DOMSource source, Exchange exchange) throws TransformerException {
        String result = toString(source, exchange);
        return new StringSource(result);
    }
View Full Code Here


        return new StringSource(result);
    }
    @Converter
    public StreamSource toStreamSourceFromStAX(StAXSource source, Exchange exchange) throws TransformerException {
        String result = toString(source, exchange);
        return new StringSource(result);
    }
View Full Code Here

public class LogDebugBodyStreamsTest extends ContextTestSupport {

    public void testLogBodyStreamStringSourceDisabled() throws Exception {
        context.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, "false");

        StringSource body = new StringSource("<?xml version=\"1.0\"?><person><name>Claus</name></person>");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);

        template.sendBody("direct:start", body);
View Full Code Here

    }

    public void testLogBodyStreamStringSourceDisabledByDefault() throws Exception {
        context.getProperties().remove(Exchange.LOG_DEBUG_BODY_STREAMS);

        StringSource body = new StringSource("<?xml version=\"1.0\"?><person><name>Claus</name></person>");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);

        template.sendBody("direct:start", body);
View Full Code Here

    }

    public void testLogBodyStreamStringSourceEnabled() throws Exception {
        context.getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, "true");

        StringSource body = new StringSource("<?xml version=\"1.0\"?><person><name>Claus</name></person>");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);

        template.sendBody("direct:start", body);
View Full Code Here

        assertTrue(result instanceof Source);
    }

    @Test
    public void consumeStockQuoteWebserviceWithCamelStringSourceInput() throws Exception {
        Object result = template.requestBody("direct:stockQuoteWebservice", new StringSource(xmlRequestForGoogleStockQuote));

        assertNotNull(result);
        assertTrue(result instanceof Source);
    }
View Full Code Here

        assertTrue(result instanceof Source);
    }

    @Test
    public void consumeStockQuoteWebserviceWithCamelStringSourceInput() throws Exception {
        Object result = template.requestBody("direct:stockQuoteWebservice", new StringSource(xmlRequestForGoogleStockQuote));

        assertNotNull(result);
        assertTrue(result instanceof Source);
    }
View Full Code Here

                from("seda:xslttest")
                        .setHeader("testheader", el("hello"))
                        .setBody(el("header:${in.headers.testheader}"))
                        .to("mock:Before")
                        .setBody(el("<cats><cat id=\"1\"/><cat id=\"2\"/></cats>"))
                        .process(XsltBuilder.xslt(new StringSource(xslt)))
                        .setBody(el("header:${in.headers.testheader}"))
                        .to("mock:After");
            }
        };
    }
View Full Code Here

        assertTrue(result instanceof Source);
    }

    @Test(timeout = 5000)
    public void consumeStockQuoteWebserviceWithCamelStringSourceInput() throws Exception {
        Object result = template.requestBody("direct:stockQuoteWebservice", new StringSource(xmlRequestForGoogleStockQuote));

        assertNotNull(result);
        assertTrue(result instanceof Source);
    }
View Full Code Here

     * Converts a Spring-WS {@link org.springframework.xml.transform.StringSource}
     * to a Camel {@link org.apache.camel.converter.jaxp.StringSource}
     */
    @Converter
    public static StringSource toStringSourceFromSpring(org.springframework.xml.transform.StringSource springStringSource) {
        return new StringSource(springStringSource.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.StringSource

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.