Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultMessage


        return false;
    }
   
    @Test
    public void testHttpConverter() throws Exception {
        Message message = new DefaultMessage();
        message.setHeader(Exchange.HTTP_SERVLET_RESPONSE, servletResponse);
        HttpServletResponse result = context.getTypeConverter().convertTo(HttpServletResponse.class, message);
        Assert.assertNotNull("The http conveter doesn't work", result);
       
    }
View Full Code Here


public class BeanInfoOverloadedTest extends ContextTestSupport {

    public void testBeanInfoOverloaded() throws Exception {
        BeanInfo beanInfo = new BeanInfo(context, Bean.class);

        Message message = new DefaultMessage();
        message.setBody(new RequestB());
        Exchange exchange = new DefaultExchange(context);
        exchange.setIn(message);

        MethodInvocation methodInvocation = beanInfo.createInvocation(new Bean(), exchange);
        Method method = methodInvocation.getMethod();
View Full Code Here

                URI keyStoreUrl = file.toURI();
                component.setSslKeystore(keyStoreUrl.getPath());

                from(URI, URIS).setExchangePattern(ExchangePattern.InOut).process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        Message out = new DefaultMessage();
                        out.setBody("reply: " + exchange.getIn().getBody());
                        exchange.setOut(out);
                    }
                });
            }
        };
View Full Code Here

        assertFalse(GZIPHelper.isGzip((String) null));
        assertFalse(GZIPHelper.isGzip("zip"));
    }

    private Message createMessageWithContentEncodingHeader(String contentEncoding) {
        Message msg = new DefaultMessage();
        msg.setHeader("Content-Encoding", contentEncoding);

        return msg;
    }
View Full Code Here

            // take care rest of them.
            // *NOTE* this feature requires Camel version >= 1.6.1
            List<Message> answer = new ArrayList<Message>();
            String[] parts = header.split(",");
            for (String part : parts) {
                DefaultMessage message = new DefaultMessage();
                message.setHeader("user", part);
                message.setBody(body);
                answer.add(message);
            }
            return answer;
        }
View Full Code Here

            // take care rest of them.
            // *NOTE* this feature requires Camel version >= 1.6.1
            List<Message> answer = new ArrayList<Message>();
            String[] parts = header.split(",");
            for (String part : parts) {
                DefaultMessage message = new DefaultMessage();
                message.setHeader("user", part);
                message.setBody(body);
                answer.add(message);
            }
            return answer;
        }
View Full Code Here

   
    private Message message;
   
    @Override
    protected void setUp() throws Exception {
        message = new DefaultMessage();
    }
View Full Code Here

public class BeanInfoAMoreComplexOverloadedTest extends ContextTestSupport {

    public void testRequestA() throws Exception {
        BeanInfo beanInfo = new BeanInfo(context, Bean.class);

        Message message = new DefaultMessage();
        message.setBody(new RequestA());
        Exchange exchange = new DefaultExchange(context);
        exchange.setIn(message);

        MethodInvocation methodInvocation = beanInfo.createInvocation(new Bean(), exchange);
        Method method = methodInvocation.getMethod();
View Full Code Here

    }

    public void testRequestB() throws Exception {
        BeanInfo beanInfo = new BeanInfo(context, Bean.class);

        Message message = new DefaultMessage();
        message.setBody(new RequestB());
        Exchange exchange = new DefaultExchange(context);
        exchange.setIn(message);

        MethodInvocation methodInvocation = beanInfo.createInvocation(new Bean(), exchange);
        Method method = methodInvocation.getMethod();
View Full Code Here

    }

    public void testAmbigious() throws Exception {
        BeanInfo beanInfo = new BeanInfo(context, Bean.class);

        Message message = new DefaultMessage();
        message.setBody("Hello World");
        Exchange exchange = new DefaultExchange(context);
        exchange.setIn(message);

        try {
            MethodInvocation methodInvocation = beanInfo.createInvocation(new Bean(), exchange);
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.DefaultMessage

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.