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

   // 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

   // Public --------------------------------------------------------

   public void testGetType() throws Exception
   {
      HornetQStreamMessage message = new HornetQStreamMessage();
      Assert.assertEquals(HornetQStreamMessage.TYPE, message.getType());
   }
View Full Code Here

   }

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

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

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

   }

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

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

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

   }

   public void testReadByteFromByte() throws Exception
   {
      byte value = RandomUtil.randomByte();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeByte(value);
      message.reset();

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

   }

   public void testReadByteFromString() throws Exception
   {
      byte value = RandomUtil.randomByte();
      HornetQStreamMessage message = new HornetQStreamMessage();

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

      Assert.assertEquals(value, message.readByte());
   }
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.