Package org.hornetq.jms.client

Examples of org.hornetq.jms.client.HornetQStreamMessage


   }

   public void testReadObjectFromDouble() throws Exception
   {
      double value = RandomUtil.randomDouble();
      HornetQStreamMessage message = new HornetQStreamMessage();
      message.writeDouble(value);

      message.reset();

      Assert.assertEquals(value, message.readObject());
   }
View Full Code Here


   }

   public void testReadObjectFromString() throws Exception
   {
      String value = RandomUtil.randomString();
      HornetQStreamMessage message = new HornetQStreamMessage();
      message.writeString(value);

      message.reset();

      Assert.assertEquals(value, message.readObject());
   }
View Full Code Here

      StreamMessage foreignStreamMessage = new SimpleJMSStreamMessage();
      foreignStreamMessage.writeByte((byte)1);
      foreignStreamMessage.writeByte((byte)2);
      foreignStreamMessage.writeByte((byte)3);

      HornetQStreamMessage copy = new HornetQStreamMessage(foreignStreamMessage, session);

      MessageHeaderTestBase.ensureEquivalent(foreignStreamMessage, copy);
   }
View Full Code Here

   // Private -------------------------------------------------------

   private void doReadTypeFromEmptyMessage(final TypeReader reader) throws Exception
   {
      HornetQStreamMessage message = new HornetQStreamMessage();
      message.reset();

      try
      {
         reader.readType(message);
         Assert.fail("MessageEOFException");
View Full Code Here

      }
   }

   private void doReadTypeFromInvalidType(final Object invalidValue, final TypeReader reader) throws Exception
   {
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeObject(invalidValue);
      message.reset();

      try
      {
         reader.readType(message);
         Assert.fail("MessageFormatException");
View Full Code Here

      }
   }

   private void doWriteObjectWithType(final Object value, final TypeReader reader) throws Exception
   {
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeObject(value);
      message.reset();

      Object v = reader.readType(message);
      if (value instanceof byte[])
      {
         UnitTestCase.assertEqualsByteArrays((byte[])value, (byte[])v);
View Full Code Here

      StreamMessage foreignStreamMessage = new SimpleJMSStreamMessage();
      foreignStreamMessage.writeByte((byte)1);
      foreignStreamMessage.writeByte((byte)2);
      foreignStreamMessage.writeByte((byte)3);

      HornetQStreamMessage copy = new HornetQStreamMessage(foreignStreamMessage, session);

      MessageHeaderTestBase.ensureEquivalent(foreignStreamMessage, copy);
   }
View Full Code Here

   }

   public void testReadDoubleFromDouble() throws Exception
   {
      double value = RandomUtil.randomDouble();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeDouble(value);
      message.reset();

      Assert.assertEquals(value, message.readDouble());
   }
View Full Code Here

   }

   public void testReadDoubleFromString() throws Exception
   {
      double value = RandomUtil.randomDouble();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeString(Double.toString(value));
      message.reset();

      Assert.assertEquals(value, message.readDouble());
   }
View Full Code Here

   }

   public void testReadStringFromBoolean() throws Exception
   {
      boolean value = RandomUtil.randomBoolean();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeBoolean(value);
      message.reset();

      Assert.assertEquals(Boolean.toString(value), message.readString());
   }
View Full Code Here

TOP

Related Classes of org.hornetq.jms.client.HornetQStreamMessage

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.