Package org.hornetq.jms.client

Examples of org.hornetq.jms.client.HornetQMapMessage


   public void testGetStringFromInt() throws Exception
   {
      int value = RandomUtil.randomInt();

      HornetQMapMessage message = new HornetQMapMessage();
      message.setInt(itemName, value);

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


   public void testGetStringFromLong() throws Exception
   {
      long value = RandomUtil.randomLong();

      HornetQMapMessage message = new HornetQMapMessage();
      message.setLong(itemName, value);

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

   public void testGetStringFromFloat() throws Exception
   {
      float value = RandomUtil.randomFloat();

      HornetQMapMessage message = new HornetQMapMessage();
      message.setFloat(itemName, value);

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

   public void testGetStringFromDouble() throws Exception
   {
      double value = RandomUtil.randomByte();

      HornetQMapMessage message = new HornetQMapMessage();
      message.setDouble(itemName, value);

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

      Assert.assertEquals(Double.toString(value), message.getString(itemName));
   }

   public void testGetStringFromNull() throws Exception
   {
      HornetQMapMessage message = new HornetQMapMessage();

      Assert.assertNull(message.getString(itemName));
   }
View Full Code Here

   public void testGetStringFromString() throws Exception
   {
      String value = RandomUtil.randomString();

      HornetQMapMessage message = new HornetQMapMessage();
      message.setString(itemName, value);

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

   }

   public void testGetBytesFromBytes() throws Exception
   {
      byte[] value = RandomUtil.randomBytes();
      HornetQMapMessage message = new HornetQMapMessage();
      message.setBytes(itemName, value);

      UnitTestCase.assertEqualsByteArrays(value, message.getBytes(itemName));
   }
View Full Code Here

      UnitTestCase.assertEqualsByteArrays(value, message.getBytes(itemName));
   }

   public void testGetBytesFromNull() throws Exception
   {
      HornetQMapMessage message = new HornetQMapMessage();

      Assert.assertNull(message.getBytes(itemName));
   }
View Full Code Here

      Assert.assertNull(message.getBytes(itemName));
   }

   public void testGetBytesFromInvalidType() throws Exception
   {
      HornetQMapMessage message = new HornetQMapMessage();
      message.setChar(itemName, RandomUtil.randomChar());

      try
      {
         message.getBytes(itemName);
         Assert.fail("MessageFormatException");
      }
      catch (MessageFormatException e)
      {
      }
View Full Code Here

   }

   public void testSetObjectFromBoolean() throws Exception
   {
      boolean value = RandomUtil.randomBoolean();
      HornetQMapMessage message = new HornetQMapMessage();
      message.setObject(itemName, value);

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

TOP

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

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.