Examples of nextMessage()


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

        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

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

        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

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

        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

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

        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 testTwoBlockOneData2Message() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.TWOBLOCKONEDATA2_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
View Full Code Here

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

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

    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

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

        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 testOneBlockBadMessage() throws Exception {
        DimeInputBuffer buff = messageBuffer(TestData.ONEBLOCKBAD_MESSAGE);
        assertTrue("Initial message", buff.nextMessage());
View Full Code Here

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

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

    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();
View Full Code Here

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

        }
    }

    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);
View Full Code Here

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

        offset = buff.getOffset();
        for (int i = 0; i < 8; i++) {
            assertEquals("Data value", i + 2, buff.getBuffer()[offset + i]);
        }
        assertTrue("Missing part", buff.nextPart());
        assertFalse("No more messages", buff.nextMessage());
    }
}
View Full Code Here

Examples of org.lilyproject.tools.mboximport.MboxInputStream.nextMessage()

public class MboxInputStreamTest {
    @Test
    public void test() throws Exception {
        MboxInputStream stream = new MboxInputStream(new ByteArrayInputStream("From someone\nfoobar\nFrom someone else\nanother foobar".getBytes()), 10000);

        stream.nextMessage();
        String msg1 = IOUtils.toString(stream);
        assertEquals("foobar\n", msg1);

        stream.nextMessage();
        String msg2 = IOUtils.toString(stream);
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.