コード例 #1
0
  @Test
  public void testJobWithExcpetion() throws InterruptedException {
    // init
    job = new TestJobWithExcepton(200);

    job.start();
    Thread.sleep(2000);
    job.stop();

    assertTrue((index > 2));
    assertTrue(isDestroy);
  }
コード例 #2
0
  @Test
  public void testJobInitFailure() throws InterruptedException {
    // init
    job = new TestJob(200);
    isInitSuccess = false;

    job.start();
    Thread.sleep(2000);
    job.stop();

    assertTrue((index == 0));
    assertTrue(isDestroy);
  }