Package org.hornetq.jms.client

Examples of org.hornetq.jms.client.HornetQStreamMessage


   }

   public void testReadStringFromChar() throws Exception
   {
      char value = RandomUtil.randomChar();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeChar(value);
      message.reset();

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


   }

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

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

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

   }

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

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

      try
      {
         message.readByte();
         fail("must throw a NumberFormatException");
      }
      catch (NumberFormatException e)
      {
      }

      // we can read the String without resetting the message
      Assert.assertEquals(value, message.readString());
   }
View Full Code Here

   }

   public void testReadStringFromShort() throws Exception
   {
      short value = RandomUtil.randomShort();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeShort(value);
      message.reset();

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

   }

   public void testReadStringFromInt() throws Exception
   {
      int value = RandomUtil.randomInt();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeInt(value);
      message.reset();

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

   }

   public void testReadStringFromLong() throws Exception
   {
      long value = RandomUtil.randomLong();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeLong(value);
      message.reset();

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

   }

   public void testReadStringFromFloat() throws Exception
   {
      float value = RandomUtil.randomFloat();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeFloat(value);
      message.reset();

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

   }

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

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

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

   }

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

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

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

      Assert.assertEquals(value, message.readString());
   }

   public void testReadStringFromNullString() throws Exception
   {
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeString(null);
      message.reset();

      Assert.assertNull(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.