MessageAckReader reader = new MessageAckReader();
assertTrue(reader.getPacketType() == Packet.ACTIVEMQ_MSG_ACK);
}
public void testReadPacket() {
MessageAck ack = new MessageAck();
ack.setId(this.id);
ack.setConsumerId(this.consumerId);
ack.setTransactionId(this.transactedId);
ack.setMessageID(messageId);
ack.setMessageRead(this.messageRead);
MessageAckWriter writer = new MessageAckWriter();
MessageAckReader reader = new MessageAckReader();
try {
byte[] data = writer.writePacketToByteArray(ack);
MessageAck mack = (MessageAck) reader.readPacketFromByteArray(data);
assertTrue(mack.getId().equals(this.id));
assertTrue(mack.getConsumerId().equals(this.consumerId));
assertTrue(mack.getTransactionId().equals(this.transactedId));
assertTrue(mack.isMessageRead()==this.messageRead);
}
catch (Throwable e) {
e.printStackTrace();
assertTrue(false);
}