Package org.apache.qpid.client.message

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


    }

    @Test
    public void testToBodyStringWithNull() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.reset();
        String result = bm.toBodyString();
        Assert.assertNull(result);
    }
View Full Code Here


     * if null was passed in during creation
     */
    @Test(expected=MessageNotReadableException.class)
    public void testNotReadableOnCreationWithNull() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.getBodyLength();
    }
View Full Code Here

    }

    @Test(expected= MessageNotWriteableException.class)
    public void testResetMakesReadble() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeInt(10);
        bm.reset();
        bm.writeInt(12);
    }
View Full Code Here

    }

    @Test
    public void testClearBodyMakesWritable() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeInt(10);
        bm.reset();
        bm.clearBody();
        bm.writeInt(10);
    }
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);
    }
View Full Code Here

    }

    @Test(expected=NullPointerException.class)
    public void testWriteObjectThrowsNPE() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeObject(null);
    }
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);       
    }
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

TOP

Related Classes of org.apache.qpid.client.message.JMSBytesMessage

Copyright © 2018 www.massapicom. 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.