Package org.servicemix.examples

Examples of org.servicemix.examples.MessageList


        QName service = new QName("http://servicemix.org/cheese/", "transformer");

        sendMessages(service, 20);
        assertMessagesReceived(20);

        MessageList messageList1 = assertMessagesReceived("service1", 20);
        MessageList messageList2 = assertMessagesReceived("service2", 20);
        MessageList messageList3 = assertMessagesReceived("service3", 40);

        assertMessageXPath(messageList1, 0, "/cheese", "Edam");
        assertMessageXPath(messageList1, 1, "/cheese", "Edam");
        assertMessageXPath(messageList1, 19, "/cheese", "Edam");
        assertMessageXPath(messageList1, 0, "/cheese/@id", "1");
View Full Code Here


    public void testSendingAndReceivingMessagesUsingSpring() throws Exception {
        Sender sender = getSender();

        sender.sendMessages(messageCount);

        MessageList messageList = getReceivedMessageList();
        messageList.assertMessagesReceived(messageCount);

        // lets now look into the received messages
        List list = messageList.getMessages();
        NormalizedMessage message = (NormalizedMessage) list.get(0);
        Object property = message.getProperty("foo");
        assertEquals("Message 'foo' header", "hello", property);
    }
View Full Code Here

    }

    protected void assertMessagesReceived(int messageCount) throws Exception {
        assertNotNull("receiver not found in JBI container", receiver);

        MessageList messageList = receiver.getMessageList();
        assertMessagesReceived(messageList, messageCount);
    }
View Full Code Here

    protected MessageList assertMessagesReceived(String receiverName, int messageCount) throws Exception {
        Receiver receiver = (Receiver) getBean(receiverName);
        assertNotNull("receiver: " + receiverName + " not found in JBI container", receiver);

        MessageList messageList = receiver.getMessageList();
        assertMessagesReceived(messageList, messageCount);
        return messageList;
    }
View Full Code Here

public class ChainedComponentTest extends SpringTestSupport {

    public void testSendingAndReceivingMessagesUsingSpring() throws Exception {
        super.testSendingAndReceivingMessagesUsingSpring();
        MessageList messageList = getReceivedMessageList();
        for (Iterator iter = messageList.getMessages().iterator(); iter.hasNext();) {
            NormalizedMessage msg = (NormalizedMessage) iter.next();
            assertNotNull(msg.getProperty("prop1"));
            assertNotNull(msg.getProperty("prop2"));
        }
    }
View Full Code Here

        QName service = new QName("http://servicemix.org/cheese/", "transformer");

        sendMessages(service, 20);
        assertMessagesReceived(20);

        MessageList messageList1 = assertMessagesReceived("service1", 20);
        MessageList messageList2 = assertMessagesReceived("service2", 20);
        MessageList messageList3 = assertMessagesReceived("service3", 20);

        assertMessageHeader(messageList1, 0, "foo", "hello world!");
        assertMessageHeader(messageList1, 1, "foo", "hello world!");
        assertMessageHeader(messageList1, 19, "foo", "hello world!");
View Full Code Here

    }

    protected void assertMessagesReceived(int messageCount) throws Exception {
        assertNotNull("receiver not found in JBI container", receiver);

        MessageList messageList = receiver.getMessageList();
        assertMessagesReceived(messageList, messageCount);
    }
View Full Code Here

    protected MessageList assertMessagesReceived(String receiverName, int messageCount) throws Exception {
        Receiver receiver = (Receiver) getBean(receiverName);
        assertNotNull("receiver: " + receiverName + " not found in JBI container", receiver);

        MessageList messageList = receiver.getMessageList();
        assertMessagesReceived(messageList, messageCount);
        return messageList;
    }
View Full Code Here

TOP

Related Classes of org.servicemix.examples.MessageList

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.