org.exolab.jmscts.test.message.util
Class MessagePopulatorVerifier

java.lang.Object
  |
  +--org.exolab.jmscts.core.AbstractMessageVerifier
        |
        +--org.exolab.jmscts.test.message.util.MessagePopulatorVerifier
All Implemented Interfaces:
MessagePopulator, MessageVerifier, java.io.Serializable
Direct Known Subclasses:
MessagePropertyVerifier

public abstract class MessagePopulatorVerifier
extends AbstractMessageVerifier
implements MessagePopulator

A helper class for populating and verifying the content of messages. This class provides no population or verification functionality - that is left to sublasses.

Version:
$Revision: 1.2 $ $Date: 2004/02/03 07:31:04 $
Author:
Tim Anderson
See Also:
AbstractMessageVerifier, MessagePopulator, Serialized Form

Constructor Summary
MessagePopulatorVerifier()
          Construct a new instance.
MessagePopulatorVerifier(java.lang.Class exception)
          Construct an instance with the expected exception thrown when methods are invoked
 
Method Summary
 void populate(javax.jms.Message message)
          Populate a message with data.
protected  byte[] populateByteArray(int length, int start)
          Helper to return a byte array of the specified length, populated with an incrementing sequence of values
 void populateBytesMessage(javax.jms.BytesMessage message)
          Populate a BytesMessage instance with data.
 void populateMapMessage(javax.jms.MapMessage message)
          Populate a MapMessage instance with data.
 void populateMessage(javax.jms.Message message)
          Populate a Message instance with data.
 void populateObjectMessage(javax.jms.ObjectMessage message)
          Populate an ObjectMessage instance with data.
 void populateStreamMessage(javax.jms.StreamMessage message)
          Populate a StreamMessage instance with data.
 void populateTextMessage(javax.jms.TextMessage message)
          Populate a TextMessage instance with data.
 
Methods inherited from class org.exolab.jmscts.core.AbstractMessageVerifier
equal, expect, expect, expect, getExpectedException, getMethods, invoke, invoke, invoke, verify, verifyBytesMessage, verifyMapMessage, verifyMessage, verifyObjectMessage, verifyStreamMessage, verifyTextMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagePopulatorVerifier

public MessagePopulatorVerifier()
Construct a new instance. No exceptions are expected to be thrown when invoking methods

MessagePopulatorVerifier

public MessagePopulatorVerifier(java.lang.Class exception)
Construct an instance with the expected exception thrown when methods are invoked
Parameters:
exception - the expected exception type when methods are invoked
Method Detail

populate

public void populate(javax.jms.Message message)
              throws java.lang.Exception
Populate a message with data. This method delegates the message to the appropriate populator method.
Specified by:
populate in interface MessagePopulator
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error

populateMessage

public void populateMessage(javax.jms.Message message)
                     throws java.lang.Exception
Populate a Message instance with data. This method throws UnsupportedOperationException if invoked. Subclasses needing the functionality must implement it.
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error
UnsupportedOperationException - if invoked

populateBytesMessage

public void populateBytesMessage(javax.jms.BytesMessage message)
                          throws java.lang.Exception
Populate a BytesMessage instance with data. This method throws UnsupportedOperationException if invoked. Subclasses needing the functionality must implement it.
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error
UnsupportedOperationException - if invoked

populateMapMessage

public void populateMapMessage(javax.jms.MapMessage message)
                        throws java.lang.Exception
Populate a MapMessage instance with data. This method throws UnsupportedOperationException if invoked. Subclasses needing the functionality must implement it.
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error
UnsupportedOperationException - if invoked

populateObjectMessage

public void populateObjectMessage(javax.jms.ObjectMessage message)
                           throws java.lang.Exception
Populate an ObjectMessage instance with data. This method throws UnsupportedOperationException if invoked. Subclasses needing the functionality must implement it.
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error
UnsupportedOperationException - if invoked

populateStreamMessage

public void populateStreamMessage(javax.jms.StreamMessage message)
                           throws java.lang.Exception
Populate a StreamMessage instance with data. This method throws UnsupportedOperationException if invoked. Subclasses needing the functionality must implement it.
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error
UnsupportedOperationException - if invoked

populateTextMessage

public void populateTextMessage(javax.jms.TextMessage message)
                         throws java.lang.Exception
Populate a TextMessage instance with data. This method throws UnsupportedOperationException if invoked. Subclasses needing the functionality must implement it.
Parameters:
message - the message to populate
Throws:
java.lang.Exception - for any error
UnsupportedOperationException - if invoked

populateByteArray

protected byte[] populateByteArray(int length,
                                   int start)
Helper to return a byte array of the specified length, populated with an incrementing sequence of values
Parameters:
length - the length of the array
start - the number to start the sequence at
Returns:
a new byte array


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