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);
ack.setPersistent(persistent);
ack.setDestination(destination);
ack.setExpired(expired);
MessageAckWriter writer = new MessageAckWriter();
MessageAckReader reader = new MessageAckReader();
try {
byte[] data = writer.writePacketToByteArray(ack);
MessageAck mack = (MessageAck) reader.readPacketFromByteArray(data);
assertTrue(mack.getConsumerId().equals(this.consumerId));
assertTrue(mack.getTransactionId().equals(this.transactedId));
assertTrue(mack.isMessageRead()==this.messageRead);
assertTrue(mack.isPersistent()==this.persistent);
assertTrue(mack.isExpired()==this.expired);
assertTrue(mack.isXaTransacted()==this.xaTransacted);
assertTrue(mack.getDestination().equals(this.destination));
}
catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
}