Package org.jibx.ws.encoding.dime

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


        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());
        assertFalse("No more messages", buff.nextMessage());
    }

    public void testBadVersionMessage() throws Exception {
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 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

    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

    public void testTwoBlockOneData2Message() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.TWOBLOCKONEDATA2_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

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

        DimeInputBuffer buff = messageBuffer(TestData.ONEBLOCKBAD_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertTrue("Missing data", buff.require(1));
        try {
            buff.require(2);
            fail();
        } catch (IOException e) {
        }
    }
View Full Code Here

    public void testTwoBlockTwoPartMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.TWOBLOCK_TWOPARTS_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
        assertTrue("Initial part", buff.nextPart());
        assertTrue("Missing data", buff.require(1));
        int offset = buff.getOffset();
        assertEquals("Data value", 1, buff.getBuffer()[offset++]);
        buff.setOffset(offset);
        assertTrue("Missing data", buff.require(8));
        offset = buff.getOffset();
View Full Code Here

        assertTrue("Initial part", buff.nextPart());
        assertTrue("Missing data", buff.require(1));
        int offset = buff.getOffset();
        assertEquals("Data value", 1, buff.getBuffer()[offset++]);
        buff.setOffset(offset);
        assertTrue("Missing data", buff.require(8));
        offset = buff.getOffset();
        for (int i = 0; i < 8; i++) {
            assertEquals("Data value", i + 2, buff.getBuffer()[offset + i]);
        }
        assertTrue("Missing part", buff.nextPart());
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.