Package javax.jms

Examples of javax.jms.StreamMessage.readString()


                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


      Assert.assertEquals("char", msg.readChar(), 'c');
      Assert.assertEquals("double", msg.readDouble(), 1.11d, 0);
      Assert.assertEquals("float", msg.readFloat(), 1.1f, 0);
      Assert.assertEquals("int", msg.readInt(), 1);
      Assert.assertEquals("short", msg.readShort(), (short) 1);
      Assert.assertEquals("string", msg.readString(), TEXT);
     
    } finally {
      try {
        s_rec.close();
      } catch (Exception ex) {
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();
                fail("Should have received MessageEOFException");
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

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

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

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

      m2.clearBody();

      try
      {
View Full Code Here

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

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

      conn.start();

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

      assertNull(rm.readString());
   }

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

   protected void prepareMessage(Message m) throws JMSException
View Full Code Here

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


}
View Full Code Here

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

}
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.