Examples of JMSBytesMessage


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

        assertTrue(result);
    }

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

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

        assertEquals(9, result);
    }

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

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

    public void testReadBytesChecksNull() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.readBytes(null);
        }
        catch (IllegalArgumentException e)
        {
            // pass
        }

        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.readBytes(null, 1);
        }
        catch (IllegalArgumentException e)
        {
            // pass
        }
View Full Code Here

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

    public void testReadBytesChecksMaxSize() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            byte[] bytes = new byte[100];
            bm.readBytes(bytes, 120);
        }
        catch (IllegalArgumentException e)
        {
            // pass
        }
View Full Code Here

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

        }
    }

    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);
        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

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

    public void testEOFByte() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeByte((byte)1);
            bm.reset();
            bm.readByte();
            // should throw
            bm.readByte();
            fail("expected exception did not occur");
        }
        catch (MessageEOFException m)
        {
            // ok
View Full Code Here

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

    public void testEOFUnsignedByte() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeByte((byte)1);
            bm.reset();
            bm.readByte();
            // should throw
            bm.readUnsignedByte();
            fail("expected exception did not occur");
        }
        catch (MessageEOFException m)
        {
            // ok
View Full Code Here

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

    public void testEOFBoolean() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeBoolean(true);
            bm.reset();
            bm.readBoolean();
            // should throw
            bm.readBoolean();
            fail("expected exception did not occur");
        }
        catch (MessageEOFException m)
        {
            // ok
View Full Code Here

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

    public void testEOFChar() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeChar('A');
            bm.reset();
            bm.readChar();
            // should throw
            bm.readChar();
            fail("expected exception did not occur");
        }
        catch (MessageEOFException m)
        {
            // ok
View Full Code Here

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

    }

    public BytesMessage createBytesMessage() throws JMSException
    {
        checkNotClosed();
        JMSBytesMessage msg = new JMSBytesMessage(getMessageDelegateFactory());
        msg.setAMQSession(this);
        return msg;
    }
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.