@Test public void testJobWithExcpetion() throws InterruptedException { // init job = new TestJobWithExcepton(200); job.start(); Thread.sleep(2000); job.stop(); assertTrue((index > 2)); assertTrue(isDestroy); }
@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); }