com.mockrunner.mock.jms
Class MockBytesMessage

java.lang.Object
  extended by com.mockrunner.mock.jms.MockMessage
      extended by com.mockrunner.mock.jms.MockBytesMessage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.jms.BytesMessage, javax.jms.Message

public class MockBytesMessage
extends MockMessage
implements javax.jms.BytesMessage

Mock implementation of JMS BytesMessage.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
MockBytesMessage()
           
 
Method Summary
 void clearBody()
           
 java.lang.Object clone()
           
 boolean equals(java.lang.Object otherObject)
          Compares the underlying byte data.
 long getBodyLength()
           
 byte[] getBytes()
          Returns a copy of the underlying byte data regardless if the message is in read or write mode.
 int hashCode()
           
 boolean readBoolean()
           
 byte readByte()
           
 int readBytes(byte[] data)
           
 int readBytes(byte[] data, int length)
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 int readInt()
           
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 void reset()
           
 java.lang.String toString()
           
 void writeBoolean(boolean value)
           
 void writeByte(byte value)
           
 void writeBytes(byte[] data)
           
 void writeBytes(byte[] data, int offset, int length)
           
 void writeChar(char value)
           
 void writeDouble(double value)
           
 void writeFloat(float value)
           
 void writeInt(int value)
           
 void writeLong(long value)
           
 void writeObject(java.lang.Object object)
           
 void writeShort(short value)
           
 void writeUTF(java.lang.String value)
           
 
Methods inherited from class com.mockrunner.mock.jms.MockMessage
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isAcknowledged, isInWriteMode, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setReadOnly, setReadOnlyProperties, setShortProperty, setStringProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.Message
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
 

Constructor Detail

MockBytesMessage

public MockBytesMessage()
Method Detail

getBodyLength

public long getBodyLength()
                   throws javax.jms.JMSException
Specified by:
getBodyLength in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readBoolean

public boolean readBoolean()
                    throws javax.jms.JMSException
Specified by:
readBoolean in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readByte

public byte readByte()
              throws javax.jms.JMSException
Specified by:
readByte in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readUnsignedByte

public int readUnsignedByte()
                     throws javax.jms.JMSException
Specified by:
readUnsignedByte in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readShort

public short readShort()
                throws javax.jms.JMSException
Specified by:
readShort in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readUnsignedShort

public int readUnsignedShort()
                      throws javax.jms.JMSException
Specified by:
readUnsignedShort in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readChar

public char readChar()
              throws javax.jms.JMSException
Specified by:
readChar in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readInt

public int readInt()
            throws javax.jms.JMSException
Specified by:
readInt in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readLong

public long readLong()
              throws javax.jms.JMSException
Specified by:
readLong in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readFloat

public float readFloat()
                throws javax.jms.JMSException
Specified by:
readFloat in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readDouble

public double readDouble()
                  throws javax.jms.JMSException
Specified by:
readDouble in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readUTF

public java.lang.String readUTF()
                         throws javax.jms.JMSException
Specified by:
readUTF in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readBytes

public int readBytes(byte[] data)
              throws javax.jms.JMSException
Specified by:
readBytes in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

readBytes

public int readBytes(byte[] data,
                     int length)
              throws javax.jms.JMSException
Specified by:
readBytes in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeBoolean

public void writeBoolean(boolean value)
                  throws javax.jms.JMSException
Specified by:
writeBoolean in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeByte

public void writeByte(byte value)
               throws javax.jms.JMSException
Specified by:
writeByte in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeShort

public void writeShort(short value)
                throws javax.jms.JMSException
Specified by:
writeShort in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeChar

public void writeChar(char value)
               throws javax.jms.JMSException
Specified by:
writeChar in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeInt

public void writeInt(int value)
              throws javax.jms.JMSException
Specified by:
writeInt in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeLong

public void writeLong(long value)
               throws javax.jms.JMSException
Specified by:
writeLong in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeFloat

public void writeFloat(float value)
                throws javax.jms.JMSException
Specified by:
writeFloat in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeDouble

public void writeDouble(double value)
                 throws javax.jms.JMSException
Specified by:
writeDouble in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeUTF

public void writeUTF(java.lang.String value)
              throws javax.jms.JMSException
Specified by:
writeUTF in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeBytes

public void writeBytes(byte[] data)
                throws javax.jms.JMSException
Specified by:
writeBytes in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeBytes

public void writeBytes(byte[] data,
                       int offset,
                       int length)
                throws javax.jms.JMSException
Specified by:
writeBytes in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

writeObject

public void writeObject(java.lang.Object object)
                 throws javax.jms.JMSException
Specified by:
writeObject in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

reset

public void reset()
           throws javax.jms.JMSException
Specified by:
reset in interface javax.jms.BytesMessage
Throws:
javax.jms.JMSException

clearBody

public void clearBody()
               throws javax.jms.JMSException
Specified by:
clearBody in interface javax.jms.Message
Overrides:
clearBody in class MockMessage
Throws:
javax.jms.JMSException

getBytes

public byte[] getBytes()
Returns a copy of the underlying byte data regardless if the message is in read or write mode.

Returns:
the byte data

equals

public boolean equals(java.lang.Object otherObject)
Compares the underlying byte data.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class MockMessage

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object