mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-11 04:46:18 -04:00
fix(task): test.
This commit is contained in:
parent
6ac2274c29
commit
e90ec531e5
@ -117,11 +117,10 @@ public class TaskTest {
|
|||||||
Assume.assumeNoException(e);
|
Assume.assumeNoException(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
System.out.println("Start");
|
|
||||||
Assert.assertFalse("Task should fail because we have cancelled it", executor.test());
|
Assert.assertFalse("Task should fail because we have cancelled it", executor.test());
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
Assert.assertNull("CancellationException should not be recorded.", executor.getException());
|
Assert.assertTrue("CancellationException should not be recorded.", executor.getException() instanceof CancellationException);
|
||||||
Assert.assertNull("CancellationException should not be recorded.", task.getException());
|
Assert.assertTrue("CancellationException should not be recorded.", task.getException() instanceof CancellationException);
|
||||||
Assert.assertTrue("Thread.sleep cannot be interrupted", flag.get());
|
Assert.assertTrue("Thread.sleep cannot be interrupted", flag.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user