Examples of streamLog()


Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        File ferr = new File(getTestCaseDir() + "/testerr.log");
        ferr.setLastModified(currTime - 8000);

        StringWriter sw = new StringWriter();
        XLogStreamer str = new XLogStreamer(xf, sw, getTestCaseDir(), "test.log", 1);
        str.streamLog(new Date(currTime - 10000), new Date(currTime - 5000));
        String[] out = sw.toString().split("\n");
        assertEquals(3, out.length);
        assertEquals(true, out[0].contains("_L1_"));
        assertEquals(true, out[1].contains("_L2_"));
        assertEquals(true, out[2].contains("_L4_"));
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        assertEquals(true, out[1].contains("_L2_"));
        assertEquals(true, out[2].contains("_L4_"));

        StringWriter sw1 = new StringWriter();
        XLogStreamer str1 = new XLogStreamer(xf, sw1, getTestCaseDir(), "test.log", 1);
        str1.streamLog(null, null);
        out = sw1.toString().split("\n");
        assertEquals(4, out.length);
        assertEquals(true, out[0].contains("_L1_"));
        assertEquals(true, out[1].contains("_L2_"));
        assertEquals(true, out[2].contains("_L4_"));
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        // Test for the log retrieval of the job that began 10 seconds before and ended 5 seconds before current time
        // respectively
        StringWriter sw = new StringWriter();
        XLogStreamer str = new XLogStreamer(xf, sw, getTestCaseDir(), "oozie.log", 1);
        str.streamLog(new Date(currTime - 10000), new Date(currTime - 5000));
        String[] out = sw.toString().split("\n");
        // Check if the retrieved log content is of length seven lines after filtering based on time window, file name
        // pattern and parameters like JobId, Username etc. and/or based on log level like INFO, DEBUG, etc.
        assertEquals(7, out.length);
        // Check if the lines of the log contain the expected strings
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        // Test to check if the null values for startTime and endTime are translated to 0 and current time respectively
        // and corresponding log content is retrieved properly
        StringWriter sw1 = new StringWriter();
        XLogStreamer str1 = new XLogStreamer(xf, sw1, getTestCaseDir(), "oozie.log", 1);
        str1.streamLog(null, null);
        out = sw1.toString().split("\n");
        // Check if the retrieved log content is of length eight lines after filtering based on time window, file name
        // pattern and parameters like JobId, Username etc. and/or based on log level like INFO, DEBUG, etc.
        assertEquals(8, out.length);
        // Check if the lines of the log contain the expected strings
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        StringWriter sw2 = new StringWriter();
        XLogStreamer str2 = new XLogStreamer(xf, sw2, getTestCaseDir(), "oozie.log", 1);
        Calendar calendarEntry = Calendar.getInstance();
        // Setting start-time to 2012-04-24-19 for log stream (month-1 passed as parameter since 0=January), and end time is current time
        calendarEntry.set(2012, 3, 24, 19, 0);
        str2.streamLog(calendarEntry.getTime(), new Date(System.currentTimeMillis()));
        String[] out = sw2.toString().split("\n");

        // Check if the retrieved log content is of length five lines after filtering based on time window, file name
        // pattern and parameters like JobId, Username etc. and/or based on log level like INFO, DEBUG, etc.
        assertEquals(5, out.length);
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        gzout.finish();
        gzout.close();

        StringWriter sw = new StringWriter();
        XLogStreamer str = new XLogStreamer(xf, sw, getTestCaseDir(), "oozie.log", 1);
        str.streamLog(new Date(currTime - 10000), new Date(currTime - 5000));
        String[] out = sw.toString().split("\n");
        assertEquals(5, out.length);
        assertEquals(true, out[0].contains("_L8_"));
        assertEquals(true, out[1].contains("_L9_"));
        assertEquals(true, out[2].contains("_L1_"));
View Full Code Here

Examples of org.apache.oozie.util.XLogStreamer.streamLog()

        assertEquals(true, out[3].contains("_L2_"));
        assertEquals(true, out[4].contains("_L4_"));

        StringWriter sw1 = new StringWriter();
        XLogStreamer str1 = new XLogStreamer(xf, sw1, getTestCaseDir(), "oozie.log", 1);
        str1.streamLog(null, null);
        out = sw1.toString().split("\n");
        assertEquals(6, out.length);
        assertEquals(true, out[0].contains("_L8_"));
        assertEquals(true, out[1].contains("_L9_"));
        assertEquals(true, out[2].contains("_L1_"));
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.