org.exolab.jmscts.core
Class MessageBodyComparer

java.lang.Object
  |
  +--org.exolab.jmscts.core.AbstractMessageComparer
        |
        +--org.exolab.jmscts.core.MessageBodyComparer
All Implemented Interfaces:
MessageComparer

public class MessageBodyComparer
extends AbstractMessageComparer

A helper class for comparing the body of two messages.

Version:
$Revision: 1.3 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Constructor Summary
MessageBodyComparer()
           
 
Method Summary
 boolean compareBytesMessages(javax.jms.BytesMessage message1, javax.jms.BytesMessage message2)
          Compare two BytesMessage instances
 boolean compareMapMessages(javax.jms.MapMessage message1, javax.jms.MapMessage message2)
          Compare two MapMessage instances
 boolean compareMessages(javax.jms.Message message1, javax.jms.Message message2)
          Compare two Message instances.
 boolean compareObjectMessages(javax.jms.ObjectMessage message1, javax.jms.ObjectMessage message2)
          Compare two ObjectMessage instances
 boolean compareStreamMessages(javax.jms.StreamMessage message1, javax.jms.StreamMessage message2)
          Compare two StreamMessage instances
 boolean compareTextMessages(javax.jms.TextMessage message1, javax.jms.TextMessage message2)
          Compare two TextMessage instances
 
Methods inherited from class org.exolab.jmscts.core.AbstractMessageComparer
compare
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageBodyComparer

public MessageBodyComparer()
Method Detail

compareMessages

public boolean compareMessages(javax.jms.Message message1,
                               javax.jms.Message message2)
                        throws java.lang.Exception
Compare two Message instances. This is a no-op, as Message instances don't have a body
Overrides:
compareMessages in class AbstractMessageComparer
Parameters:
message1 - one message to be tested for equality
message2 - the other message to be tested for equality
Returns:
true if the messages bodies are equal
Throws:
java.lang.Exception - for any error

compareBytesMessages

public boolean compareBytesMessages(javax.jms.BytesMessage message1,
                                    javax.jms.BytesMessage message2)
                             throws java.lang.Exception
Compare two BytesMessage instances
Overrides:
compareBytesMessages in class AbstractMessageComparer
Parameters:
message1 - one message to be tested for equality
message2 - the other message to be tested for equality
Returns:
true if the messages bodies are equal
Throws:
java.lang.Exception - for any error

compareMapMessages

public boolean compareMapMessages(javax.jms.MapMessage message1,
                                  javax.jms.MapMessage message2)
                           throws java.lang.Exception
Compare two MapMessage instances
Overrides:
compareMapMessages in class AbstractMessageComparer
Parameters:
message1 - one message to be tested for equality
message2 - the other message to be tested for equality
Returns:
true if the messages bodies are equal
Throws:
java.lang.Exception - for any error

compareObjectMessages

public boolean compareObjectMessages(javax.jms.ObjectMessage message1,
                                     javax.jms.ObjectMessage message2)
                              throws java.lang.Exception
Compare two ObjectMessage instances
Overrides:
compareObjectMessages in class AbstractMessageComparer
Parameters:
message1 - one message to be tested for equality
message2 - the other message to be tested for equality
Returns:
true if the messages bodies are equal
Throws:
java.lang.Exception - for any error

compareStreamMessages

public boolean compareStreamMessages(javax.jms.StreamMessage message1,
                                     javax.jms.StreamMessage message2)
                              throws java.lang.Exception
Compare two StreamMessage instances
Overrides:
compareStreamMessages in class AbstractMessageComparer
Parameters:
message1 - one message to be tested for equality
message2 - the other message to be tested for equality
Returns:
true if the messages bodies are equal
Throws:
java.lang.Exception - for any error

compareTextMessages

public boolean compareTextMessages(javax.jms.TextMessage message1,
                                   javax.jms.TextMessage message2)
                            throws java.lang.Exception
Compare two TextMessage instances
Overrides:
compareTextMessages in class AbstractMessageComparer
Parameters:
message1 - one message to be tested for equality
message2 - the other message to be tested for equality
Returns:
true if the messages bodies are equal
Throws:
java.lang.Exception - for any error


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.