public void testReadPacket() {
DefaultWireFormat wf = new DefaultWireFormat();
ActiveMQTextMessageReader reader = new ActiveMQTextMessageReader(wf);
ActiveMQTextMessageWriter writer = new ActiveMQTextMessageWriter(wf);
ActiveMQTextMessage msg1 = new ActiveMQTextMessage();
try {
msg1.setText(this.testStr);
super.initializeMessage(msg1);
byte[] data = writer.writePacketToByteArray(msg1);
ActiveMQTextMessage msg2 = (ActiveMQTextMessage) reader.readPacketFromByteArray(data);
super.testEquals(msg1, msg2);
assertTrue(msg1.getText().equals(msg2.getText()));
}
catch (IOException e) {
e.printStackTrace();
assertTrue(false);
}