public static LogMonitor createLogMonitor(SparkLoadAppHandle handle) {
        return new LogMonitor(handle);
    }
@Test
    public void testLogMonitorNormal() {
        URL log = getClass().getClassLoader().getResource("spark_launcher_monitor.log");
        String cmd = "cat " + log.getPath();
        SparkLoadAppHandle handle = null;
        try {
            Process process = Runtime.getRuntime().exec(cmd);
            handle = new SparkLoadAppHandle(process);
            SparkLauncherMonitor.LogMonitor logMonitor = SparkLauncherMonitor.createLogMonitor(handle);
            logMonitor.setRedirectLogPath(logPath);
            logMonitor.start();
            try {
                logMonitor.join();
            } catch (InterruptedException e) {
            }
        } catch (IOException e) {
            Assert.fail();
        }

        // check values
        Assert.assertEquals(appId, handle.getAppId());
        Assert.assertEquals(state, handle.getState());
        Assert.assertEquals(queue, handle.getQueue());
        Assert.assertEquals(startTime, handle.getStartTime());
        Assert.assertEquals(finalApplicationStatus, handle.getFinalStatus());
        Assert.assertEquals(trackingUrl, handle.getUrl());
        Assert.assertEquals(user, handle.getUser());

        // check log
        File file = new File(logPath);
        Assert.assertTrue(file.exists());
    }