Package org.apache.qpid.client.message

Examples of org.apache.qpid.client.message.JMSBytesMessage.reset()


    @Test
    public void testClearBodyMakesWritable() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeInt(10);
        bm.reset();
        bm.clearBody();
        bm.writeInt(10);
    }

    @Test
View Full Code Here


    @Test
    public void testWriteInt() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeInt(10);
        bm.reset();
        long len = bm.getBodyLength();
        Assert.assertTrue(len == 4);
        int val = bm.readInt();
        Assert.assertTrue(val == 10);
    }
View Full Code Here

    @Test
    public void testWriteString() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeUTF("Bananas");
        bm.reset();
        String res = bm.readUTF();
        Assert.assertEquals("Bananas", res);
    }

    @Test(expected=NullPointerException.class)
View Full Code Here

    @Test
    public void testReadBoolean() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeBoolean(true);
        bm.reset();
        boolean result = bm.readBoolean();
        Assert.assertTrue(result);       
    }

    @Test(expected=MessageEOFException.class)
View Full Code Here

    @Test(expected=MessageEOFException.class)
    public void testEOFByte() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)1);
        bm.reset();
        bm.readByte();
        // should throw
        bm.readByte();
    }
View Full Code Here

    @Test(expected=MessageEOFException.class)
    public void testEOFUnsignedByte() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)1);
        bm.reset();
        bm.readByte();
        // should throw
        bm.readUnsignedByte();
    }
View Full Code Here

    @Test(expected=MessageEOFException.class)
    public void testEOFBoolean() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeBoolean(true);
        bm.reset();
        bm.readBoolean();
        // should throw
        bm.readBoolean();
    }
View Full Code Here

    @Test(expected=MessageEOFException.class)
    public void testEOFChar() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeChar('A');
        bm.reset();
        bm.readChar();
        // should throw
        bm.readChar();
    }
View Full Code Here

    @Test(expected=MessageEOFException.class)
    public void testEOFDouble() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeDouble(1.3d);
        bm.reset();
        bm.readDouble();
        // should throw
        bm.readDouble();
    }
View Full Code Here

    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeInt(10);
            bm.reset();
            bm.writeInt(12);
            fail("expected exception did not occur");
        }
        catch (MessageNotWriteableException m)
        {
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.