Examples of JMSBytesMessage


Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test(expected=MessageEOFException.class)
    public void testEOFFloat() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeFloat(1.3f);
        bm.reset();
        bm.readFloat();
        // should throw
        bm.readFloat();
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test(expected=MessageEOFException.class)
    public void testEOFInt() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeInt(99);
        bm.reset();
        bm.readInt();
        // should throw
        bm.readInt();
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test(expected=MessageEOFException.class)
    public void testEOFLong() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeLong(4L);
        bm.reset();
        bm.readLong();
        // should throw
        bm.readLong();
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test(expected=MessageEOFException.class)
    public void testEOFShort() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeShort((short)4);
        bm.reset();
        bm.readShort();
        // should throw
        bm.readShort();
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test(expected=MessageEOFException.class)
    public void testEOFUnsignedShort() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeShort((short)4);
        bm.reset();
        bm.readUnsignedShort();
        // should throw
        bm.readUnsignedShort();
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

     * @throws Exception
     */
    @Test
    public void testReadBytes() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)3);
        bm.writeByte((byte)4);
        bm.reset();
        byte[] result = new byte[2];
        int count = bm.readBytes(result);
        Assert.assertEquals((byte)3, result[0]);
        Assert.assertEquals((byte)4, result[1]);
        Assert.assertEquals(2, count);
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test
    public void testReadBytesEOF() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)3);
        bm.writeByte((byte)4);
        bm.reset();
        byte[] result = new byte[2];
        bm.readBytes(result);
        int count = bm.readBytes(result);
        Assert.assertEquals(-1, count);
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test
    public void testReadBytesWithLargerArray() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)3);
        bm.writeByte((byte)4);
        bm.reset();
        byte[] result = new byte[3];
        int count = bm.readBytes(result);
        Assert.assertEquals(2, count);
        Assert.assertEquals((byte)3, result[0]);
        Assert.assertEquals((byte)4, result[1]);
        Assert.assertEquals((byte)0, result[2]);
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test
    public void testReadBytesWithCount() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)3);
        bm.writeByte((byte)4);
        bm.writeByte((byte)5);
        bm.reset();
        byte[] result = new byte[3];
        int count = bm.readBytes(result, 2);
        Assert.assertEquals(2, count);
        Assert.assertEquals((byte)3, result[0]);
        Assert.assertEquals((byte)4, result[1]);
        Assert.assertEquals((byte)0, result[2]);
    }
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage

    }

    @Test
    public void testToBodyString() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        final String testText = "This is a test";
        bm.writeUTF(testText);
        bm.reset();
        String result = bm.toBodyString();
        Assert.assertEquals(testText, result);
    }
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.