Package org.jibx.ws.encoding.dime

Examples of org.jibx.ws.encoding.dime.DimeInputBuffer.nextMessage()


        return dbuff;
    }

    public void testEmptyMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.EMPTY_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertEquals("Wrong offset", DimeCommon.HEADER_SIZE, buff.getOffset());
        assertEquals("Wrong limit", DimeCommon.HEADER_SIZE, buff.getLimit());
        assertFalse("No data in message", buff.require(1));
        assertFalse("No more parts in message", buff.nextPart());
View Full Code Here


        assertTrue("Initial part", buff.nextPart());
        assertEquals("Wrong offset", DimeCommon.HEADER_SIZE, buff.getOffset());
        assertEquals("Wrong limit", DimeCommon.HEADER_SIZE, buff.getLimit());
        assertFalse("No data in message", buff.require(1));
        assertFalse("No more parts in message", buff.nextPart());
        assertFalse("No more messages", buff.nextMessage());
    }

    public void testBadVersionMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.BAD_VERSION_MESSAGE);
        try {
View Full Code Here

    }

    public void testBadVersionMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.BAD_VERSION_MESSAGE);
        try {
            assertTrue("Initial message", buff.nextMessage());
            buff.nextPart();
            fail();
        } catch (IOException e) {
        }
    }
View Full Code Here

    }

    public void testNotFirstMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.NOT_FIRST_MESSAGE);
        try {
            assertTrue("Initial message", buff.nextMessage());
            buff.nextPart();
            fail();
        } catch (IOException e) {
        }
    }
View Full Code Here

        }
    }

    public void testNotLastMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.NOT_LAST_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        try {
            buff.nextPart();
            fail();
        } catch (IOException e) {
View Full Code Here

        }
    }

    public void testChunkedNoChunkMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.CHUNKED_NOCHUNK_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        try {
            buff.require(1);
            fail();
        } catch (IOException e) {
View Full Code Here

        }
    }

    public void testOptIdTypeOnlyMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.OPTIDTYPEONLY_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertEquals("Record id", "bc", buff.getPartIdentifier());
        assertEquals("Record type", DimeCommon.TYPE_MEDIA, buff.getPartTypeCode());
        assertEquals("Record type text", "def", buff.getPartTypeText());
    }
View Full Code Here

        assertEquals("Record type text", "def", buff.getPartTypeText());
    }

    public void testOneBlockOneDataMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.ONEBLOCKONEDATA_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertTrue("Missing data", buff.require(1));
        assertEquals("Data value", 1, buff.getBuffer()[buff.getOffset()]);
        assertFalse("No more parts in message", buff.nextPart());
        assertFalse("No more messages", buff.nextMessage());
View Full Code Here

        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertTrue("Missing data", buff.require(1));
        assertEquals("Data value", 1, buff.getBuffer()[buff.getOffset()]);
        assertFalse("No more parts in message", buff.nextPart());
        assertFalse("No more messages", buff.nextMessage());
    }

    public void testTwoBlockOneData1Message() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.TWOBLOCKONEDATA1_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
View Full Code Here

        assertFalse("No more messages", buff.nextMessage());
    }

    public void testTwoBlockOneData1Message() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.TWOBLOCKONEDATA1_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertTrue("Missing data", buff.require(1));
        assertEquals("Data value", 1, buff.getBuffer()[buff.getOffset()]);
        assertFalse("No more parts in message", buff.nextPart());
        assertFalse("No more messages", buff.nextMessage());
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.