Package org.apache.qpid.client.message

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


    public void testStringConversions() throws Exception
    {
        JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("true");
        bm.reset();
        assertEquals(true, bm.readBoolean());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("2");
        bm.reset();
        assertEquals((byte)2, bm.readByte());
View Full Code Here


        bm.writeString("true");
        bm.reset();
        assertEquals(true, bm.readBoolean());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("2");
        bm.reset();
        assertEquals((byte)2, bm.readByte());
        bm.reset();
        assertEquals((short)2, bm.readShort());
        bm.reset();
        assertEquals(2, bm.readInt());
View Full Code Here

        assertEquals(true, bm.readBoolean());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("2");
        bm.reset();
        assertEquals((byte)2, bm.readByte());
        bm.reset();
        assertEquals((short)2, bm.readShort());
        bm.reset();
        assertEquals(2, bm.readInt());
        bm.reset();
        assertEquals((long)2, bm.readLong());
View Full Code Here

        bm.writeString("2");
        bm.reset();
        assertEquals((byte)2, bm.readByte());
        bm.reset();
        assertEquals((short)2, bm.readShort());
        bm.reset();
        assertEquals(2, bm.readInt());
        bm.reset();
        assertEquals((long)2, bm.readLong());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("5.7");
View Full Code Here

        assertEquals((byte)2, bm.readByte());
        bm.reset();
        assertEquals((short)2, bm.readShort());
        bm.reset();
        assertEquals(2, bm.readInt());
        bm.reset();
        assertEquals((long)2, bm.readLong());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("5.7");
        bm.reset();
        assertEquals(5.7f, bm.readFloat());
View Full Code Here

        assertEquals(2, bm.readInt());
        bm.reset();
        assertEquals((long)2, bm.readLong());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("5.7");
        bm.reset();
        assertEquals(5.7f, bm.readFloat());
        bm.reset();
        assertEquals(5.7d, bm.readDouble());
    }
View Full Code Here

        assertEquals((long)2, bm.readLong());
        bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("5.7");
        bm.reset();
        assertEquals(5.7f, bm.readFloat());
        bm.reset();
        assertEquals(5.7d, bm.readDouble());
    }

    public void testNulls() throws Exception
    {
View Full Code Here

    public void testNulls() throws Exception
    {
        JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString(null);
        bm.writeObject(null);
        bm.reset();
        assertNull(bm.readObject());
        assertNull(bm.readObject());
    }

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

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

    public void testReadBytesChecksNull() throws Exception
View Full Code Here

        JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
        byte[] bytes = {2, 3};
        bm.writeBytes(bytes);
        bm.writeBytes(null);
        bm.writeBytes(new byte[]{});
        bm.reset();
        int len = bm.readBytes(bytes);
        assertEquals(2, len);
        len = bm.readBytes(bytes);
        assertEquals(-1, len);
        len = bm.readBytes(bytes);
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.