Package javax.jms

Examples of javax.jms.StreamMessage.readByte()


      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);
      assertTrue("Bytes == Bytes[]",
View Full Code Here


        con.start();

        StreamMessage msg2 = (StreamMessage) consumer.receive(2000);
        assertNotNull(msg2);

        msg2.readByte();
        try
        {
            msg2.readByte();
            fail("Expected exception not thrown");
        }
View Full Code Here

        assertNotNull(msg2);

        msg2.readByte();
        try
        {
            msg2.readByte();
            fail("Expected exception not thrown");
        }
        catch (Exception e)
        {
            assertTrue("Expected MessageEOFException: " + e, e instanceof MessageEOFException);
View Full Code Here

                    bodyMessage.setBody(textMsg.getText());
                    break;
                case Stream:
                    StreamMessage streamMessage = (StreamMessage) message;
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    int next = streamMessage.readByte();
                    while (next > -1) {
                        baos.write(next);
                        next = streamMessage.readByte();
                    }
                    baos.flush();
View Full Code Here

                    StreamMessage streamMessage = (StreamMessage) message;
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    int next = streamMessage.readByte();
                    while (next > -1) {
                        baos.write(next);
                        next = streamMessage.readByte();
                    }
                    baos.flush();
                    bodyMessage.setHeader(JMS_MESSAGE_TYPE, JmsMessageType.Bytes);
                    bodyMessage.setBody(baos.toByteArray());
                    break;
View Full Code Here

                    bodyMessage.setBody(textMsg.getText());
                    break;
                case Stream:
                    StreamMessage streamMessage = (StreamMessage)message;
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    int next = streamMessage.readByte();
                    while (next > -1) {
                        baos.write(next);
                        next = streamMessage.readByte();
                    }
                    baos.flush();
View Full Code Here

                    StreamMessage streamMessage = (StreamMessage)message;
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    int next = streamMessage.readByte();
                    while (next > -1) {
                        baos.write(next);
                        next = streamMessage.readByte();
                    }
                    baos.flush();
                    bodyMessage.setHeader(JMS_MESSAGE_TYPE, JmsMessageType.Bytes);
                    bodyMessage.setBody(baos.toByteArray());
                    break;
View Full Code Here

      StreamMessage sm = (StreamMessage)m;

      sm.reset();

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

      sm.writeByte(bValue);
      sm.setStringProperty("COM_SUN_JMS_TESTNAME", "xMessageEOFExceptionQTestforStreamMessage");
      queueProducer.send(sm);

      StreamMessage received = (StreamMessage)queueConsumer.receive(3000);
      received.readByte();
   }

   public void testBytesMessage() throws Exception
   {
      BytesMessage m = queueProducerSession.createBytesMessage();
View Full Code Here

      queueProducer.send(HornetQServerTestCase.queue1, m);

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

      ProxyAssertSupport.assertEquals(myBool, m2.readBoolean());
      ProxyAssertSupport.assertEquals(myByte, m2.readByte());
      ProxyAssertSupport.assertEquals(myShort, m2.readShort());
      ProxyAssertSupport.assertEquals(myChar, m2.readChar());
      ProxyAssertSupport.assertEquals(myInt, m2.readInt());
      ProxyAssertSupport.assertEquals(myLong, m2.readLong());
      ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0);
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.