Examples of writePacketToByteArray()


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

      msg1.setBooleanProperty("booleanprop",true);
      msg1.setLongProperty("longproperty",67l);
      msg1.setFloatProperty("floatproperty",4.6f);
      super.initializeMessage(msg1);
      for (int i = 0; i < count; i++){
        byte[] data = writer.writePacketToByteArray(msg1);
        msg2 = (ActiveMQStreamMessage) 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.ActiveMQTextMessageWriter.writePacketToByteArray()

    ActiveMQTextMessageWriter writer = new ActiveMQTextMessageWriter();
    ActiveMQTextMessage msg1 = new ActiveMQTextMessage();
    try {
      msg1.setText(this.testStr);
      super.initializeMessage(msg1);
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQTextMessage msg2 = (ActiveMQTextMessage) reader.readPacketFromByteArray(data);
      super.testEquals(msg1, msg2);
      assertTrue(msg1.getText().equals(msg2.getText()));
    }
    catch (IOException e) {
View Full Code Here

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

      long startTime = System.currentTimeMillis();
      //msg1.setText(this.testStr);
      msg1.setText("this is a test str");
      super.initializeMessage(msg1);
      for (int i = 0; i < count; i++){
        byte[] data = writer.writePacketToByteArray(msg1);
        msg2 = (ActiveMQTextMessage) 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.ConsumerInfoWriter.writePacketToByteArray()

    info.setStarted(this.started);
   
    ConsumerInfoWriter writer = new ConsumerInfoWriter();
    ConsumerInfoReader reader = new ConsumerInfoReader();
    try {
    byte[] data = writer.writePacketToByteArray(info);
    ConsumerInfo testInfo = (ConsumerInfo) reader.readPacketFromByteArray(data);
   
      assertTrue(testInfo.getId().equals(this.consumerId));
      assertTrue(testInfo.getConsumerNo()==this.consumerNo);
            assertTrue(testInfo.getPrefetchNumber() == this.prefetchNumber);
View Full Code Here

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

    ConsumerInfo testInfo = null;
    try {
      int count = 100000;
      long startTime = System.currentTimeMillis();
      for (int i = 0; i < count; i++){
        byte[] data = writer.writePacketToByteArray(info);
        testInfo = (ConsumerInfo) 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.MessageAckWriter.writePacketToByteArray()

        ack.setDestination(destination);

    MessageAckWriter writer = new MessageAckWriter();
    MessageAckReader reader = new MessageAckReader();
    try {
      byte[] data = writer.writePacketToByteArray(ack);
      MessageAck mack = (MessageAck) reader.readPacketFromByteArray(data);

      assertTrue(mack.getId().equals(this.id));
      assertTrue(mack.getConsumerId().equals(this.consumerId));
            assertTrue(mack.getTransactionId().equals(this.transactedId));
View Full Code Here

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

    MessageAckReader reader = new MessageAckReader();
    try {
      int count = 100000;
      long startTime = System.currentTimeMillis();
      for (int i = 0; i < count; i++) {
        byte[] data = writer.writePacketToByteArray(ack);
        MessageAck mack = (MessageAck) 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.MessageAckWriter.writePacketToByteArray()

        ack.setMessageRead(this.messageRead);

    MessageAckWriter writer = new MessageAckWriter();
    MessageAckReader reader = new MessageAckReader();
    try {
      byte[] data = writer.writePacketToByteArray(ack);
      MessageAck mack = (MessageAck) reader.readPacketFromByteArray(data);

      assertTrue(mack.getId().equals(this.id));
      assertTrue(mack.getConsumerId().equals(this.consumerId));
            assertTrue(mack.getTransactionId().equals(this.transactedId));
View Full Code Here

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

    MessageAckReader reader = new MessageAckReader();
    try {
      int count = 100000;
      long startTime = System.currentTimeMillis();
      for (int i = 0; i < count; i++) {
        byte[] data = writer.writePacketToByteArray(ack);
        MessageAck mack = (MessageAck) reader.readPacketFromByteArray(data);
      }
      long finishTime = System.currentTimeMillis();
      long totalTime = finishTime - startTime;
      long ps = (count * 1000) / totalTime;
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.