Package javax.jms

Examples of javax.jms.StreamMessage.readString()


         ObjectMessage om2 = (ObjectMessage)theConsumer.receive(1500);
         assertEquals("aardvark", (String)om2.getObject());

         StreamMessage sm2 = (StreamMessage)theConsumer.receive(1500);
         assertEquals("aardvark", sm2.readString());
      }
      finally
      {
         if (theConn != null)
         {
View Full Code Here


         recv.readDouble() == 3.1415926535897932384626433832795);
      assertTrue("Float == true", recv.readFloat() == 3.141f);
      assertTrue("Object == 31415926535897932384626433832795",
         recv.readObject().equals("31415926535897932384626433832795"));
      assertTrue("String == 31415926535897932384626433832795",
         recv.readString().equals("31415926535897932384626433832795"));
   }

   protected void setUp() throws Exception
   {
       // call setUp() in superclass
View Full Code Here

         ObjectMessage om2 = (ObjectMessage)theConsumer.receive(1500);
         ProxyAssertSupport.assertEquals("aardvark", (String)om2.getObject());

         StreamMessage sm2 = (StreamMessage)theConsumer.receive(1500);
         ProxyAssertSupport.assertEquals("aardvark", sm2.readString());

         TextMessage tm2 = (TextMessage)theConsumer.receive(1500);
         ProxyAssertSupport.assertEquals("aardvark", tm2.getText());
      }
      finally
View Full Code Here

      conn.start();

      StreamMessage rm = (StreamMessage)queueCons.receive();

      ProxyAssertSupport.assertNull(rm.readString());
   }

   // Protected -----------------------------------------------------

   @Override
View Full Code Here

      ProxyAssertSupport.assertEquals(new Float(9.0), new Float(sm.readFloat()));
      ProxyAssertSupport.assertEquals(10, sm.readInt());
      ProxyAssertSupport.assertEquals(11l, sm.readLong());
      ProxyAssertSupport.assertEquals("this is an object", sm.readObject());
      ProxyAssertSupport.assertEquals((short)12, sm.readShort());
      ProxyAssertSupport.assertEquals("this is a String", sm.readString());
   }

}
View Full Code Here

      ProxyAssertSupport.assertEquals(myChar, m2.readChar());
      ProxyAssertSupport.assertEquals(myInt, m2.readInt());
      ProxyAssertSupport.assertEquals(myLong, m2.readLong());
      ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0);
      ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0);
      ProxyAssertSupport.assertEquals(myString, m2.readString());

      byte[] bytes = new byte[6];
      int ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(6, ret);
View Full Code Here

      ProxyAssertSupport.assertEquals(myShort, m2.readShort());
      ProxyAssertSupport.assertEquals(myInt, m2.readInt());
      ProxyAssertSupport.assertEquals(myLong, m2.readLong());
      ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0);
      ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0);
      ProxyAssertSupport.assertEquals(myString, m2.readString());

      bytes = new byte[6];
      ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(6, ret);
      assertByteArraysEqual(myBytes, bytes);
View Full Code Here

      ProxyAssertSupport.assertEquals(myChar, m2.readChar());
      ProxyAssertSupport.assertEquals(myInt, m2.readInt());
      ProxyAssertSupport.assertEquals(myLong, m2.readLong());
      ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0);
      ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0);
      ProxyAssertSupport.assertEquals(myString, m2.readString());

      m2.clearBody();

      try
      {
View Full Code Here

      ProxyAssertSupport.assertEquals(sm.readFloat(), 2.0F, 0.0F);
      ProxyAssertSupport.assertEquals(sm.readInt(), 3);
      ProxyAssertSupport.assertEquals(sm.readLong(), 4L);
      ProxyAssertSupport.assertEquals(sm.readObject(), "object");
      ProxyAssertSupport.assertEquals(sm.readShort(), (short)5);
      ProxyAssertSupport.assertEquals(sm.readString(), "stringvalue");
   }

}
View Full Code Here

                message.readByte();
                fail("Should have received NumberFormatException");
            } catch (NumberFormatException e) {
            }

            assertEquals("This is a test to see how it works.", message.readString());

            // Invalid conversion should throw exception and not move the stream
            // position.
            try {
                message.readByte();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.