Package org.apache.camel

Examples of org.apache.camel.Message


        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<?> it = ObjectHelper.createIterator(msg);
        assertEquals("a", it.next());
        assertEquals("b", it.next());
        assertEquals("c", it.next());
View Full Code Here


            // expected
        }
    }

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

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

            assertEquals("no more element available for '' at the index 0", nsee.getMessage());
        }
    }

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

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

     * Log new issues.  Not really needed for this test, but useful for debugging.
     */
    public class NewIssueProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            BasicIssue issue = in.getBody(BasicIssue.class);
            LOG.debug("Got issue with id " + issue.getId() + " key " + issue.getKey());
        }
View Full Code Here

     * Log new comments.  Not really needed for this test, but useful for debugging.
     */
    public class NewCommentProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            Comment comment = (Comment) in.getBody();
            LOG.debug("Got comment with id " + comment.getId() + " Body " + comment.getBody());
        }
View Full Code Here

    }

    public class RepositoryTagProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            RepositoryTag tag = (RepositoryTag) in.getBody();
            log.debug("Got TAG  [" + tag.getName() + "]");
        }
View Full Code Here

    }

    public class MockPullRequestProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            PullRequest pullRequest = (PullRequest) in.getBody();
            User pullRequestUser = pullRequest.getUser();

            pullRequest.getTitle();
            pullRequest.getHtmlUrl();
            pullRequest.getUser().getLogin();
View Full Code Here

               
                // send reply
                template.send("jms:dummy", ExchangePattern.InOnly, new Processor() {
                    public void process(Exchange exchange) throws Exception {

                        Message in = exchange.getIn();
                        in.setBody("Re: " + body);
                        in.setHeader(JmsConstants.JMS_DESTINATION_NAME, "baz");
                        in.setHeader("JMSCorrelationID", cid);
                    }
                });
            } catch (Exception e) {
                // ignore
            }
View Full Code Here


    public class MockPullRequestCommentProducerProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            Map<String, Object> headers = in.getHeaders();
            headers.put("GitHubPullRequest", latestPullRequestId);
        }
View Full Code Here


    public class ClosePullRequestProducerProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            Map<String, Object> headers = in.getHeaders();
            headers.put("GitHubPullRequest", latestPullRequestId);
        }
View Full Code Here

TOP

Related Classes of org.apache.camel.Message

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.