Пример #1
0
  /**
   * Tests task scheduling.
   *
   * @throws Exception If task scheduling fails.
   */
  @Test
  public void test0schedule() throws Exception {
    taskService.schedule(LogTask.class);
    taskService.schedule(CronTask.class);
    Thread.sleep(5000);

    assertTrue(LogTask.executionCount > 0);
    assertTrue(CronTask.executionCount > 0);
  }
Пример #2
0
 @Override
 protected void tearDown() throws Exception {
   taskService.unschedule(LogTask.class);
   taskService.unschedule(CronTask.class);
 }