ProducerInfoReader reader = new ProducerInfoReader();
assertTrue(reader.getPacketType() == Packet.PRODUCER_INFO);
}
public void testReadPacket() {
ProducerInfo info = new ProducerInfo();
info.setId(this.producerId);
info.setClientId(this.clientId);
info.setDestination(this.destination);
info.setStartTime(this.startTime);
info.setStarted(this.started);
ProducerInfoWriter writer = new ProducerInfoWriter();
ProducerInfoReader reader = new ProducerInfoReader();
try {
byte[] data = writer.writePacketToByteArray(info);
ProducerInfo testInfo = (ProducerInfo) reader.readPacketFromByteArray(data);
assertTrue(testInfo.getId().equals(this.producerId));
assertTrue(testInfo.getClientId().equals(this.clientId));
assertTrue(testInfo.getDestination().equals(this.destination));
assertTrue(testInfo.getStartTime() == this.startTime);
assertTrue(testInfo.isStarted() == this.started);
}
catch (Throwable e) {
e.printStackTrace();
assertTrue(false);
}