Package com.dtolabs.rundeck.core.utils

Examples of com.dtolabs.rundeck.core.utils.PartialLineBuffer.readLine()


*/
public class TestPartialLineBuffer extends TestCase {

    public void testPartialLineBuffer() {
        final PartialLineBuffer partialLineBuffer = new PartialLineBuffer();
        assertNull(partialLineBuffer.readLine());
        assertNull(partialLineBuffer.getPartialLine());

        char[] data = "Test1".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);
        assertNull(partialLineBuffer.readLine());
View Full Code Here


        assertNull(partialLineBuffer.readLine());
        assertNull(partialLineBuffer.getPartialLine());

        char[] data = "Test1".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);
        assertNull(partialLineBuffer.readLine());
        assertEquals("Test1", partialLineBuffer.getPartialLine());
        assertNull(partialLineBuffer.getPartialLine());

        data = " Test2".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);
View Full Code Here

        assertNull(partialLineBuffer.getPartialLine());

        data = " Test2".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertNull(partialLineBuffer.readLine());
        assertEquals("Test1 Test2", partialLineBuffer.getPartialLine());
        assertNull(partialLineBuffer.getPartialLine());

        data = " Test3\n".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);
View Full Code Here

        assertNull(partialLineBuffer.getPartialLine());

        data = " Test3\n".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertEquals("Test1 Test2 Test3", partialLineBuffer.readLine());
        assertNull(partialLineBuffer.readLine());
        assertNull("not null: '" + partialLineBuffer.getPartialLine(false) + "'", partialLineBuffer.getPartialLine(
            false));
    }
View Full Code Here

        data = " Test3\n".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertEquals("Test1 Test2 Test3", partialLineBuffer.readLine());
        assertNull(partialLineBuffer.readLine());
        assertNull("not null: '" + partialLineBuffer.getPartialLine(false) + "'", partialLineBuffer.getPartialLine(
            false));
    }

    public void testSplit() {
View Full Code Here

        assertEquals(2, arr5.length);
    }

    public void testPartialLineBufferMultiSplit() {
        PartialLineBuffer partialLineBuffer = new PartialLineBuffer();
        assertNull(partialLineBuffer.readLine());
        assertNull(partialLineBuffer.getPartialLine());

        //multiline

        char[] data = "Test4\nTest5".toCharArray();
View Full Code Here

        //multiline

        char[] data = "Test4\nTest5".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertEquals("Test4", partialLineBuffer.readLine());
        assertNull(partialLineBuffer.readLine());
        assertEquals("Test5", partialLineBuffer.getPartialLine());
        assertNull(partialLineBuffer.getPartialLine());

        data = " Test6\r\nTest7".toCharArray();
View Full Code Here

        char[] data = "Test4\nTest5".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertEquals("Test4", partialLineBuffer.readLine());
        assertNull(partialLineBuffer.readLine());
        assertEquals("Test5", partialLineBuffer.getPartialLine());
        assertNull(partialLineBuffer.getPartialLine());

        data = " Test6\r\nTest7".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);
View Full Code Here

        assertNull(partialLineBuffer.getPartialLine());

        data = " Test6\r\nTest7".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertEquals("Test5 Test6", partialLineBuffer.readLine());
        assertNull(partialLineBuffer.readLine());
        assertEquals("Test7", partialLineBuffer.getPartialLine());
        assertNull(partialLineBuffer.getPartialLine());

        data = " Test8\rTest9".toCharArray();
View Full Code Here

        data = " Test6\r\nTest7".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);

        assertEquals("Test5 Test6", partialLineBuffer.readLine());
        assertNull(partialLineBuffer.readLine());
        assertEquals("Test7", partialLineBuffer.getPartialLine());
        assertNull(partialLineBuffer.getPartialLine());

        data = " Test8\rTest9".toCharArray();
        partialLineBuffer.addData(data, 0, data.length);
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.