Package org.activemq.message

Examples of org.activemq.message.ActiveMQStreamMessage


     * @return an ActiveMQStreamMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public StreamMessage createStreamMessage() throws JMSException {
        checkClosed();
        return new ActiveMQStreamMessage();
    }
View Full Code Here


     * @return an ActiveMQStreamMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public StreamMessage createStreamMessage() throws JMSException {
        checkClosed();
        return new ActiveMQStreamMessage();
    }
View Full Code Here

     * @return an ActiveMQStreamMessage
     * @throws JMSException if the JMS provider fails to create this message due to some internal error.
     */
    public StreamMessage createStreamMessage() throws JMSException {
        checkClosed();
        return new ActiveMQStreamMessage();
    }
View Full Code Here

  public ActiveMQStreamMessageReaderTest(String arg0) {
    super(arg0);
  }

  public void testGetPacketType() {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    assertTrue(msg.getPacketType() == Packet.ACTIVEMQ_STREAM_MESSAGE);
  }
View Full Code Here

  public void testReadPacket() {
        DefaultWireFormat wf = new DefaultWireFormat();
    ActiveMQStreamMessageReader reader = new ActiveMQStreamMessageReader(wf);
    ActiveMQStreamMessageWriter writer = new ActiveMQStreamMessageWriter(wf);
    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)));
      }
    }
    catch (IOException e) {
      e.printStackTrace();
      assertTrue(false);
View Full Code Here

  public void testTime(){

        DefaultWireFormat wf = new DefaultWireFormat();
    ActiveMQStreamMessageReader reader = new ActiveMQStreamMessageReader(wf);
    ActiveMQStreamMessageWriter writer = new ActiveMQStreamMessageWriter(wf);
    ActiveMQStreamMessage msg1 = new ActiveMQStreamMessage();
   
    ActiveMQStreamMessage msg2 = null;
    try {
      int count = 10000;
      long startTime = System.currentTimeMillis();
   
      msg1.setBooleanProperty("booleanprop",true);
View Full Code Here

    super(arg0);
  }

  public void testGetPacketType()
  {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    assertTrue(msg.getPacketType() == Packet.ACTIVEMQ_STREAM_MESSAGE);
  }
View Full Code Here

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

  public void testShallowCopy()
  {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    byte[] data = new byte[50];
   
    try {
            msg.setBodyAsBytes(data,0,data.length);
            ActiveMQStreamMessage msg2 = (ActiveMQStreamMessage)msg.shallowCopy();
      assertTrue(msg2.getBodyAsBytes() != null && msg2.getBodyAsBytes()==msg.getBodyAsBytes());
    }catch(Exception ioe){
      ioe.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

    }
  }

  public void testDeepCopy()
  {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    byte[] data = new byte[50];
    msg.setBodyAsBytes(data,0,data.length);
   
    try {
            ActiveMQStreamMessage msg2 = (ActiveMQStreamMessage)msg.deepCopy();
      assertTrue(msg2.getBodyAsBytes() != null &&
          msg2.getBodyAsBytes()!=msg.getBodyAsBytes() &&
          msg2.getBodyAsBytes().getLength()==data.length);
    }catch(Exception ioe){
      ioe.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

  }
 
  public void testSetData()
  {

    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    byte[] data = new byte[50];
    msg.setBodyAsBytes(data,0,data.length);
    try {
      assertTrue(data==msg.getBodyAsBytes().getBuf());
    }catch(IOException ioe){
      ioe.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

TOP

Related Classes of org.activemq.message.ActiveMQStreamMessage

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.