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


        assertEquals(Boolean.FALSE, ObjectHelper.toBoolean(Integer.valueOf("0")));
        assertEquals(null, ObjectHelper.toBoolean(new Date()));
    }

    public void testIteratorWithMessage() {
        Message msg = new DefaultMessage();
        msg.setBody("a,b,c");

        Iterator<String> it = CastUtils.cast(ObjectHelper.createIterator(msg));
        assertEquals("a", it.next());
        assertEquals("b", it.next());
        assertEquals("c", it.next());
View Full Code Here

        assertEquals("c", it.next());
        assertFalse(it.hasNext());
    }

    public void testIteratorWithEmptyMessage() {
        Message msg = new DefaultMessage();
        msg.setBody("");

        Iterator<Object> it = ObjectHelper.createIterator(msg);
        assertFalse(it.hasNext());
    }
View Full Code Here

        Iterator<Object> it = ObjectHelper.createIterator(msg);
        assertFalse(it.hasNext());
    }

    public void testIteratorWithNullMessage() {
        Message msg = new DefaultMessage();
        msg.setBody(null);

        Iterator<Object> it = ObjectHelper.createIterator(msg);
        assertFalse(it.hasNext());
    }
View Full Code Here

            if (lines.size() >= endpoint.getGroupLines()) {
                // spit out lines
                Exchange exchange = endpoint.createExchange();

                // create message with the lines
                Message msg = new DefaultMessage();
                List<Object> copy = new ArrayList<Object>(lines);
                msg.setBody(copy);
                exchange.setIn(msg);

                // clear lines
                lines.clear();

                getProcessor().process(exchange);
            }
        } else {
            // single line
            Exchange exchange = endpoint.createExchange();

            Message msg = new DefaultMessage();
            msg.setBody(line);
            exchange.setIn(msg);

            getProcessor().process(exchange);
        }
    }
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 {
            beanInfo.createInvocation(new Bean(), exchange);
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

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.