Verifies that if a read method throws MessageFormatException or NumberFormatException, the current position of the read pointer is not be incremented, and that a subsequent read is capable of recovering from the exception by re-reading the data as a different type.
NOTE: With the exception of the readUTF() method, it is difficult to conceive test cases for read methods.

  • A provider that implements BytesMessage using a DataInputStream or equivalent, is likely to only throw MessageFormatException for the readUTF() method.
    The other likely exceptions are MessageEOFException for stream overruns, and JMSException for any other error.
  • As BytesMessage does not support conversion, NumberFormatException is unlikely to be thrown.



1 QueueConnectionFactory TRANSACTED BytesMessage Yes
2 QueueConnectionFactory AUTO BytesMessage Yes
3 QueueConnectionFactory CLIENT BytesMessage Yes
4 QueueConnectionFactory DUPS_OK BytesMessage Yes
5 TopicConnectionFactory TRANSACTED BytesMessage Yes
6 TopicConnectionFactory AUTO BytesMessage Yes
7 TopicConnectionFactory CLIENT BytesMessage Yes
8 TopicConnectionFactory DUPS_OK BytesMessage Yes