Examples of writePacketToByteArray()


Examples of org.codehaus.activemq.message.ActiveMQBytesMessageWriter.writePacketToByteArray()

    ActiveMQBytesMessageWriter writer = new ActiveMQBytesMessageWriter();
    ActiveMQBytesMessage msg1 = new ActiveMQBytesMessage();
    try {
      msg1.setBodyAsBytes(testdata);
      super.initializeMessage(msg1);
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQBytesMessage msg2 = (ActiveMQBytesMessage) reader.readPacketFromByteArray(data);
      super.testEquals(msg1, msg2);
      byte[] d2 = msg2.getBodyAsBytes();
      assertTrue(d2.length==testdata.length);
      for(int i = 0; i < testdata.length; i++)
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQBytesMessageWriter.writePacketToByteArray()

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

Examples of org.codehaus.activemq.message.ActiveMQMapMessageWriter.writePacketToByteArray()

    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

Examples of org.codehaus.activemq.message.ActiveMQMapMessageWriter.writePacketToByteArray()

      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

Examples of org.codehaus.activemq.message.ActiveMQMessageWriter.writePacketToByteArray()

    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);
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQMessageWriter.writePacketToByteArray()

    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

Examples of org.codehaus.activemq.message.ActiveMQMessageWriter.writePacketToByteArray()

    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

Examples of org.codehaus.activemq.message.ActiveMQObjectMessageWriter.writePacketToByteArray()

    ActiveMQObjectMessageWriter writer = new ActiveMQObjectMessageWriter();
    ActiveMQObjectMessage msg1 = new ActiveMQObjectMessage();
    try {
      msg1.setObject(this.table);
      super.initializeMessage(msg1);
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQObjectMessage msg2 = (ActiveMQObjectMessage) reader.readPacketFromByteArray(data);
      super.testEquals(msg1, msg2);
      assertTrue(msg1.getObject().equals(msg2.getObject()));
    }
    catch (IOException e) {
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQObjectMessageWriter.writePacketToByteArray()

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

Examples of org.codehaus.activemq.message.ActiveMQStreamMessageWriter.writePacketToByteArray()

    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)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.