Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQMapMessageWriter


    assertTrue(msg.getPacketType() == Packet.ACTIVEMQ_MAP_MESSAGE);
  }

  public void testReadPacket() {
    ActiveMQMapMessageReader reader = new ActiveMQMapMessageReader();
    ActiveMQMapMessageWriter writer = new ActiveMQMapMessageWriter();
    ActiveMQMapMessage msg1 = new ActiveMQMapMessage();
    try {
      msg1.setTable(this.table);
      super.initializeMessage(msg1);
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQMapMessage msg2 = (ActiveMQMapMessage) reader.readPacketFromByteArray(data);
      super.testEquals(msg1, msg2);
      assertTrue(msg1.getTable().equals(msg2.getTable()));
    }
        catch(JMSException jmsEx){
View Full Code Here


  }

  public void testTime() {

    ActiveMQMapMessageReader reader = new ActiveMQMapMessageReader();
    ActiveMQMapMessageWriter writer = new ActiveMQMapMessageWriter();
    ActiveMQMapMessage msg1 = new ActiveMQMapMessage();

    ActiveMQMapMessage msg2 = null;
    try {
      int count = 10000;
      long startTime = System.currentTimeMillis();

      msg1.setTable(this.table);
      super.initializeMessage(msg1);
      for (int i = 0; i < count; i++) {
        byte[] data = writer.writePacketToByteArray(msg1);
        msg2 = (ActiveMQMapMessage) reader.readPacketFromByteArray(data);
      }
      long finishTime = System.currentTimeMillis();
      long totalTime = finishTime - startTime;
      long ps = (count * 1000) / totalTime;
View Full Code Here

TOP

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

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.