Package fm.last.citrine.model

Examples of fm.last.citrine.model.TaskRun


    assertTrue(taskRunManager.isRunning(task.getId()));
    waitForTask(task);
    assertFalse(taskRunManager.isRunning(task.getId()));
    List<TaskRun> taskRuns = taskRunManager.findByTaskId(task.getId());
    assertEquals(1, taskRuns.size());
    TaskRun taskRun = taskRuns.get(0);
    assertEquals(Status.SUCCESS, taskRun.getStatus());

    // we slept so there should be no output at all
    assertNull(taskRun.getStackTrace());
    assertTrue(StringUtils.isEmpty(taskRun.getSysOut()));
    assertTrue(StringUtils.isEmpty(taskRun.getSysErr()));
  }
View Full Code Here


    waitForTask(task);
    assertFalse(taskRunManager.isRunning(task.getId()));
    List<TaskRun> taskRuns = taskRunManager.findByTaskId(task.getId());
    assertEquals(1, taskRuns.size());
    TaskRun taskRun = taskRuns.get(0);
    assertEquals(Status.SUCCESS, taskRun.getStatus());

    // now that task has finished, try run it again
    schedulerManager.runTaskNow(task);
    Thread.sleep(1000); // give task time to get started
    assertTrue(taskRunManager.isRunning(task.getId()));
View Full Code Here

      // expected
    }
    waitForTask(task);
    List<TaskRun> taskRuns = taskRunManager.findByTaskId(task.getId());
    assertEquals(1, taskRuns.size());
    TaskRun taskRun = taskRuns.get(0); // most recent job run should be first in list, i.e. the one that aborted
    assertEquals(Status.SUCCESS, taskRun.getStatus());
    assertTrue(StringUtils.isEmpty(taskRun.getStackTrace()));
    assertTrue(StringUtils.isEmpty(taskRun.getSysOut()));
    assertTrue(StringUtils.isEmpty(taskRun.getSysErr()));
  }
View Full Code Here

    schedulerManager.runTaskNow(task1);
    waitForTask(task2);

    List<TaskRun> taskRuns = taskRunManager.findByTaskId(task1.getId());
    assertEquals(1, taskRuns.size());
    TaskRun taskRun = taskRuns.get(0);
    assertEquals(Status.SUCCESS, taskRun.getStatus());

    taskRuns = taskRunManager.findByTaskId(task2.getId());
    assertEquals(1, taskRuns.size());
    taskRun = taskRuns.get(0);
    assertEquals(Status.SUCCESS, taskRun.getStatus());
  }
View Full Code Here

    Thread.sleep(1000);

    List<TaskRun> taskRuns = taskRunManager.findByTaskId(failTask.getId());
    assertEquals(1, taskRuns.size());
    TaskRun jobRun = taskRuns.get(0);
    assertEquals(Status.FAILED, jobRun.getStatus());

    assertEquals(0, taskRunManager.findByTaskId(task2.getId()).size());
  }
View Full Code Here

    schedulerManager.runTaskNow(failTask);
    waitForTask(task2); // job2 should run even though failJob fails

    List<TaskRun> taskRuns = taskRunManager.findByTaskId(failTask.getId());
    assertEquals(1, taskRuns.size());
    TaskRun taskRun = taskRuns.get(0);
    assertEquals(Status.FAILED, taskRun.getStatus());

    assertEquals(1, taskRunManager.findByTaskId(task2.getId()).size());
  }
View Full Code Here

    schedulerManager.runTaskNow(task1);
    waitForTask(task1);

    List<TaskRun> taskRuns = taskRunManager.findByTaskId(task1.getId());
    assertEquals(1, taskRuns.size());
    TaskRun taskRun = taskRuns.get(0);
    assertEquals(Status.SUCCESS, taskRun.getStatus());

    // wait once for task2 just to make sure it hasn't actually run
    waitForTask(task2, 1);

    // task 2 is disabled, so even though it is child of 1, it should not run
View Full Code Here

   * @return A ModelAndView to render.
   * @throws Exception
   */
  public ModelAndView displayStack(HttpServletRequest request, HttpServletResponse response) throws Exception {
    long taskRunId = getTaskRunId(request);
    TaskRun taskRun = taskRunManager.get(taskRunId);
    String message = taskRun.getStackTrace();
    return newEscapedMessageModelAndView(message);
  }
View Full Code Here

   * @return A ModelAndView to render.
   * @throws Exception
   */
  public ModelAndView displaySysOut(HttpServletRequest request, HttpServletResponse response) throws Exception {
    long jobRunId = getTaskRunId(request);
    TaskRun taskRun = taskRunManager.get(jobRunId);
    String message = taskRun.getSysOut();
    return newEscapedMessageModelAndView(message);
  }
View Full Code Here

   * @return A ModelAndView to render.
   * @throws Exception
   */
  public ModelAndView displaySysErr(HttpServletRequest request, HttpServletResponse response) throws Exception {
    long taskRunId = getTaskRunId(request);
    TaskRun taskRun = taskRunManager.get(taskRunId);
    String message = taskRun.getSysErr();
    return newEscapedMessageModelAndView(message);
  }
View Full Code Here

TOP

Related Classes of fm.last.citrine.model.TaskRun

Copyright © 2018 www.massapicom. 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.