Package org.apache.qpid.client.message

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


    }

    public void testToBodyStringWithNull() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.reset();
        String result = bm.toBodyString();
        assertEquals("\"\"", result);
    }

    public static junit.framework.Test suite()
View Full Code Here


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

    public void testWriteBytes() throws Exception
View Full Code Here

    public void testWriteBytes() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        byte[] bytes = {1,2,3,4};
        bm.writeBytes(bytes, 1, 2);
        bm.reset();
        bytes = new byte[2];
        bm.readBytes(bytes);
        assertEquals(2, bytes[0]);
        assertEquals(3, bytes[1]);
    }
View Full Code Here

        bm.writeObject(new Integer(101));
        bm.writeObject(new Long(50003222L));
        bm.writeObject("Foobar");
        bm.writeObject(new Float(1.7f));
        bm.writeObject(new Double(8.7d));
        bm.reset();
        assertTrue(bm.readBoolean());
        assertTrue(!bm.readBoolean());
        assertEquals((byte)2, bm.readByte());
        byte[] bytes = new byte[4];
        bm.readBytes(bytes);
View Full Code Here

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

    public void testReadUnsignedByte() throws Exception
View Full Code Here

    public void testReadUnsignedByte() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte) 9);
        bm.reset();
        int result = bm.readUnsignedByte();
        assertEquals(9, result);
    }

    public void testReadUnsignedShort() throws Exception
View Full Code Here

    public void testReadUnsignedShort() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeShort((byte) 9);
        bm.reset();
        int result = bm.readUnsignedShort();
        assertEquals(9, result);
    }

    public void testReadBytesChecksNull() throws Exception
View Full Code Here

    public void testReadBytesReturnsCorrectLengths() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        byte[] bytes = {2, 3};
        bm.writeBytes(bytes);
        bm.reset();
        int len = bm.readBytes(bytes);
        assertEquals(2, len);
        len = bm.readBytes(bytes);
        assertEquals(-1, len);
        len = bm.readBytes(bytes, 2);
View Full Code Here

        assertEquals(2, len);
        len = bm.readBytes(bytes);
        assertEquals(-1, len);
        len = bm.readBytes(bytes, 2);
        assertEquals(-1, len);
        bm.reset();
        len = bm.readBytes(bytes, 2);
        assertEquals(2, len);
        bm.reset();
        len = bm.readBytes(bytes, 1);
        assertEquals(1, len);
View Full Code Here

        len = bm.readBytes(bytes, 2);
        assertEquals(-1, len);
        bm.reset();
        len = bm.readBytes(bytes, 2);
        assertEquals(2, len);
        bm.reset();
        len = bm.readBytes(bytes, 1);
        assertEquals(1, len);

    }
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.