Sending the same message multiple times results in a MessageNotWriteable exception
This is due to the fact that this test resends the same TextMessage many times but the reset method on AbstractJMSMessage was performing a flip() on the buffer rather a rewind() between each message send. This was caused by the logic that decides whether to perform a flip or rewind being driven by the _isReadable flag when really the choice should be made depending on whether or not the buffer has 'just been written to' as opposed to 'just read'. A new flag to distinguish these two conditions, _changedData, has been introduced into AbstractJMSMessage and all methods in its derived child classes set this flag whenever they have just written to the buffer, so that the next reset and subsequent resets work correctly.
The _changedData flag is initially set to true if an AbstractJMSMessage is created with no data, so that reset works correctly on null messages. When AbstractJMSMessage is created with data, the buffer passed to it has already been flipped, so _changedData is set to false.
A patch to fix this is included.