org.apache.servicemix.tck
Class MessageList
java.lang.Object
junit.framework.Assert
org.apache.servicemix.tck.MessageList
- All Implemented Interfaces:
- MessageListener
public class MessageList
- extends Assert
- implements MessageListener
A simple container for performing testing and rendezvous style code.
- Version:
- $Revision: 564607 $
| Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageList
public MessageList()
MessageList
public MessageList(Object semaphore)
flushMessages
public List flushMessages()
- Returns:
- all the messages on the list so far, clearing the buffer
getMessages
public List getMessages()
addMessage
public void addMessage(javax.jbi.messaging.NormalizedMessage message)
throws javax.jbi.messaging.MessagingException
- Throws:
javax.jbi.messaging.MessagingException
addMessage
public void addMessage(String message)
throws javax.jbi.messaging.MessagingException
- Throws:
javax.jbi.messaging.MessagingException
getMessageCount
public int getMessageCount()
waitForMessagesToArrive
public void waitForMessagesToArrive(int messageCount)
waitForMessagesToArrive
public void waitForMessagesToArrive(int messageCount,
long baseTimeout)
assertMessagesReceived
public void assertMessagesReceived(int messageCount)
- Performs a testing assertion that the correct number of messages have
been received
- Parameters:
messageCount -
hasReceivedMessage
public boolean hasReceivedMessage()
hasReceivedMessages
public boolean hasReceivedMessages(int messageCount)
onMessage
public void onMessage(javax.jbi.messaging.MessageExchange exchange,
Message message)
throws Exception
- Description copied from interface:
MessageListener
- Processes the message. By the completion of this method call, without exceptions
being thrown the message is assumed to be processed unless the status is updated
on the exchange.
- Specified by:
onMessage in interface MessageListener
- Throws:
Exception - if the message could not be processed correctly
Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.