Package org.apache.servicemix.tck

Examples of org.apache.servicemix.tck.MessageList


        client.send(createTestMessageExchange(4));
        client.send(createTestMessageExchange(1));
        client.send(createTestMessageExchange(3));
        client.send(createTestMessageExchange(5));
        client.send(createTestMessageExchange(2));
        MessageList ml = receiver.getMessageList();
        ml.waitForMessagesToArrive(numMessages);
        assertEquals("wrong number of messages", numMessages, ml.getMessageCount());
        for (int i = 0; i < numMessages; i++) {
            assertSequenceProperties((NormalizedMessage)ml.getMessages().get(i), i + 1);
        }
        for (int i = 0; i < numMessages; i++) {
            MessageExchange me = (InOnly)client.receive();
            assertEquals(ExchangeStatus.DONE, me.getStatus());
        }
View Full Code Here


        JbiTestSupport {
    private ReceiverComponent receiverComponent = new ReceiverComponent();

    public void testCamelInvokingJbi() throws Exception {
        sendExchange("<foo bar='123'/>");
        MessageList list = receiverComponent.getMessageList();

        list.assertMessagesReceived(1);
        List messages = list.getMessages();
        NormalizedMessage message = (NormalizedMessage) messages.get(0);
        assertNotNull("null message!", message);
        log.info("Received: " + message);

        assertEquals("cheese header", 123, message.getProperty("cheese"));
View Full Code Here

public class SendFromCamelToJbiTest extends JbiTestSupport {
    private ReceiverComponent receiverComponent = new ReceiverComponent();

    public void testCamelInvokingJbi() throws Exception {
        sendExchange("<foo bar='123'/>");
        MessageList list = receiverComponent.getMessageList();

        list.assertMessagesReceived(1);
        List messages = list.getMessages();
        NormalizedMessage message = (NormalizedMessage) messages.get(0);
        assertNotNull("null message!", message);
        log.info("Received: " + message);

        assertEquals("cheese header", 123, message.getProperty("cheese"));
View Full Code Here

        client.send(createTestMessageExchange(1));
        client.send(createTestMessageExchange(3));
        client.send(createTestMessageExchange(5));
        client.send(createTestMessageExchange(2));
        tm.commit();
        MessageList ml = receiver.getMessageList();
        ml.waitForMessagesToArrive(numMessages);
        assertEquals("wrong number of messages", numMessages, ml.getMessageCount());
        for (int i = 0; i < numMessages; i++) {
            assertSequenceProperties((NormalizedMessage)ml.getMessages().get(i), i + 1);
        }
        for (int i = 0; i < numMessages; i++) {
            MessageExchange me = (InOnly)client.receive();
            assertEquals(ExchangeStatus.DONE, me.getStatus());
        }
View Full Code Here

    private ReceiverComponent receiverComponent = new ReceiverComponent();

    public void testCamelInvokingJbi() throws Exception {
        sendExchangeAsync("<foo bar='123'/>");
        MessageList list = receiverComponent.getMessageList();

        list.assertMessagesReceived(1);
        List messages = list.getMessages();
        NormalizedMessage message = (NormalizedMessage) messages.get(0);
        assertNotNull("null message!", message);
        log.info("Received: " + message);

        assertEquals("cheese header", 123, message.getProperty("cheese"));
View Full Code Here

        client.send(createTestMessageExchange(4));
        client.send(createTestMessageExchange(1));
        client.send(createTestMessageExchange(3));
        client.send(createTestMessageExchange(5));
        client.send(createTestMessageExchange(2));
        MessageList ml = receiver.getMessageList();
        ml.waitForMessagesToArrive(numMessages);
        assertEquals("wrong number of messages", numMessages, ml.getMessageCount());
        for (int i = 0; i < numMessages; i++) {
            assertSequenceProperties((NormalizedMessage)ml.getMessages().get(i), i + 1);
        }
        for (int i = 0; i < numMessages; i++) {
            MessageExchange me = (InOnly)client.receive();
            assertEquals(ExchangeStatus.DONE, me.getStatus());
        }
View Full Code Here

    }

    public void testWithoutProperties() throws Exception {
        container.activateComponent(createEndpoint(false), "servicemix-jms");
        jmsTemplate.send("destination", new InternalCreator());
        MessageList messageList = receiver.getMessageList();
        messageList.assertMessagesReceived(1);
        NormalizedMessage message = (NormalizedMessage)messageList.getMessages().get(0);
        assertNull("Not expected property found", message.getProperty(MSG_PROPERTY));
        assertNull("Not expected property found", message.getProperty(MSG_PROPERTY_BLACKLISTED));
    }
View Full Code Here

    }

    public void testConsumerSimple() throws Exception {
        container.activateComponent(createEndpoint(), "servicemix-jms");
        jmsTemplate.send("destination", new InternalCreator());
        MessageList messageList = receiver.getMessageList();
        messageList.assertMessagesReceived(1);
        NormalizedMessage message = (NormalizedMessage)messageList.getMessages().get(0);
        assertNotNull("Expected property not found", message.getProperty(MSG_PROPERTY));
        assertNull("Black listed property found", message.getProperty(MSG_PROPERTY_BLACKLISTED));
    }
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

        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

TOP

Related Classes of org.apache.servicemix.tck.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.