Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQMessageWriter


    assertTrue(reader.getPacketType() == Packet.ACTIVEMQ_MESSAGE);
  }

  public void testReadPacket() throws Exception{
    ActiveMQMessageReader reader = new ActiveMQMessageReader();
    ActiveMQMessageWriter writer = new ActiveMQMessageWriter();
    ActiveMQMessage msg1 = new ActiveMQMessage();
    initializeMessage(msg1);
   
    byte[] data = writer.writePacketToByteArray(msg1);
    ActiveMQMessage msg2 = (ActiveMQMessage) reader.readPacketFromByteArray(data);
    testEquals(msg1, msg2);
         ActiveMQMessage msg3 = msg2.shallowCopy();
         testEquals(msg1,msg3);
         data = writer.writePacketToByteArray(msg3);
         ActiveMQMessage msg4 = (ActiveMQMessage) reader.readPacketFromByteArray(data);
         testEquals(msg1,msg4);
   

  }
View Full Code Here


    assertTrue(reader.getPacketType() == Packet.ACTIVEMQ_MESSAGE);
  }

  public void testReadPacket() {
    ActiveMQMessageReader reader = new ActiveMQMessageReader();
    ActiveMQMessageWriter writer = new ActiveMQMessageWriter();
    ActiveMQMessage msg1 = new ActiveMQMessage();
    initializeMessage(msg1);
    try {
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQMessage msg2 = (ActiveMQMessage) reader.readPacketFromByteArray(data);
      testEquals(msg1, msg2);
    }
    catch (IOException ioe) {
      ioe.printStackTrace();
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.ActiveMQMessageWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.