Package javax.jms

Examples of javax.jms.StreamMessage.readBoolean()


   {
      super.assertEquivalent(m, mode, redelivery);

      StreamMessage sm = (StreamMessage)m;

      ProxyAssertSupport.assertTrue(sm.readBoolean());

      byte bytes[] = new byte[5];
      sm.readBytes(bytes);
      String s = new String(bytes);
      ProxyAssertSupport.assertEquals("jboss", s);
View Full Code Here


      /* Commit the session to clear the queue */
      s_rec.commit();
      /* Check, that the text of the message is still the same */
     
      Assert.assertEquals("byte", msg.readByte(), (byte) 0);
      Assert.assertEquals("boolean", msg.readBoolean(), true);
      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);
View Full Code Here

      sent.writeObject("31415926535897932384626433832795");
      sent.writeString("31415926535897932384626433832795");

      StreamMessage recv = (StreamMessage) sendRecMsg(sent);
      log.debug("recv: "+recv);
      assertTrue("Boolean == true", recv.readBoolean() == true);
      assertTrue("Byte == 1", recv.readByte() == 1);
      // Quirky spec behavior requires a read past the end of the byte[] field
      byte[] bytes = new byte[testBytes.length];
      recv.readBytes(bytes);
      assertTrue(recv.readBytes(bytes) < 0);
View Full Code Here

      assertEquals(myBytes[4], bytes2[2]);

      ret = m2.readBytes(bytes2);
      assertEquals(-1, ret);

      assertEquals(myBool, m2.readBoolean());
      assertEquals(myByte, m2.readByte());
      assertEquals(myShort, m2.readShort());
      assertEquals(myInt, m2.readInt());
      assertEquals(myLong, m2.readLong());
      assertEquals(myFloat, m2.readFloat(), 0);
View Full Code Here

      assertEquals(-1, ret);

      //Try and read past the end of the stream
      try
      {
         m2.readBoolean();
         fail();
      }
      catch (MessageEOFException e)
      {
      }
View Full Code Here

      }

      m2.reset();

      // check we go back to the beginning
      assertEquals(myBool, m2.readBoolean());
      assertEquals(myByte, m2.readByte());
      assertEquals(myShort, m2.readShort());
      assertEquals(myChar, m2.readChar());
      assertEquals(myInt, m2.readInt());
      assertEquals(myLong, m2.readLong());
View Full Code Here

      m2.clearBody();

      try
      {
         //Should now be write only
         m2.readBoolean();
         fail();
      }
      catch (MessageNotReadableException e)
      {
      }
View Full Code Here

      m2.writeBoolean(myBool);

      m2.reset();

      assertEquals(myBool, m2.readBoolean());
      try
      {
         m2.readBoolean();
         fail();
      }
View Full Code Here

      m2.reset();

      assertEquals(myBool, m2.readBoolean());
      try
      {
         m2.readBoolean();
         fail();
      }
      catch (MessageEOFException e)
      {
      }
View Full Code Here

      }

      //Reading should not be possible when message is read-write
      try
      {
         m.readBoolean();
         fail();
      }
      catch (javax.jms.MessageNotReadableException e)
      {
      }
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.