Package javax.jms

Examples of javax.jms.BytesMessage.readByte()


            BytesMessage message = (BytesMessage)consumer.receive(1000);
            assertNotNull(message);
            assertTrue(message.readBoolean());

            try {
                message.readByte();
                fail("Expected exception not thrown.");
            } catch (MessageEOFException e) {
            }

        }
View Full Code Here


        bytesMessage.reset();

        try {
          for (;;) {
            bosream.write(bytesMessage.readByte());
          }
        } catch (MessageEOFException ex) {
          // NOP
        }
View Full Code Here

                msg.setConnection(connection);
                try {
                    for (;;) {
                        // Reads a byte from the message stream until the stream
                        // is empty
                        msg.writeByte(bytesMsg.readByte());
                    }
                } catch (MessageEOFException e) {
                    // if an end of message stream as expected
                } catch (JMSException e) {
                }
View Full Code Here

      sent.writeUTF("31415926535897932384626433832795");

      BytesMessage recv = (BytesMessage) sendRecMsg(sent);
      log.debug("recv: "+recv);
      assertTrue("Boolean == true", recv.readBoolean() == true);
      assertTrue("Byte == 1", recv.readByte() == 1);
      byte[] bytes = new byte[testBytes.length];
      recv.readBytes(bytes);
      assertTrue("Bytes == Bytes[]",
         Arrays.equals(bytes, testBytes));
      assertTrue("Char == c", recv.readChar() == 'c');
View Full Code Here

      assertEquals(myBytes[2], bytes2[0]);
      assertEquals(myBytes[3], bytes2[1]);
      assertEquals(myBytes[4], bytes2[2]);

      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);
      assertEquals(myDouble, m2.readDouble(), 0);
View Full Code Here

         // OK
      }

      try
      {
         m2.readByte();
         fail();
      }
      catch (MessageEOFException e)
      {
         // OK
View Full Code Here

      BytesMessage m2 = (BytesMessage)queueConsumer.receive(2000);

      assertNotNull(m2);

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

      super.assertEquivalent(m, mode);

      BytesMessage bm = (BytesMessage)m;

      assertEquals(true, bm.readBoolean());
      assertEquals((byte)3, bm.readByte());
      byte[] bytes = new byte[3];
      bm.readBytes(bytes);
      assertEquals((byte)4, bytes[0]);
      assertEquals((byte)5, bytes[1]);
      assertEquals((byte)6, bytes[2]);
View Full Code Here

            BytesMessage message = (BytesMessage)consumer.receive(1000);
            assertNotNull(message);
            assertTrue( message.readBoolean() );
   
            try {
                message.readByte();
                fail("Expected exception not thrown.");
            } catch (MessageEOFException e) {           
            }
           
        }
View Full Code Here

        msg.writeByte((byte)12);
       
        // Make sure message is write-only
        try
        {
          msg.readByte();
          fail("Should have failed");
        }
        catch (MessageNotReadableException e)
        {
          // Ignore
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.