ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
assertTrue(msg.getPacketType() == Packet.ACTIVEMQ_STREAM_MESSAGE);
}
public void testReadPacket() {
ActiveMQStreamMessageReader reader = new ActiveMQStreamMessageReader();
ActiveMQStreamMessageWriter writer = new ActiveMQStreamMessageWriter();
ActiveMQStreamMessage msg1 = new ActiveMQStreamMessage();
try {
msg1.setBooleanProperty("booleanprop",true);
msg1.setLongProperty("longproperty",67l);
msg1.setFloatProperty("floatproperty",4.6f);
super.initializeMessage(msg1);
byte[] data = writer.writePacketToByteArray(msg1);
ActiveMQStreamMessage msg2 = (ActiveMQStreamMessage) reader.readPacketFromByteArray(data);
super.testEquals(msg1, msg2);
for (Enumeration e = msg1.getPropertyNames();e.hasMoreElements();){
String name = e.nextElement().toString();
assertTrue(msg1.getObjectProperty(name).equals(msg2.getObjectProperty(name)));
}