From e90ec531e5fa35b07afbe9a1ed4ed521b148bc30 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sun, 19 Sep 2021 00:43:22 +0800 Subject: [PATCH] fix(task): test. --- HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java b/HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java index 48eefa2dc..ec21230b5 100644 --- a/HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java +++ b/HMCLCore/src/test/java/org/jackhuang/hmcl/util/TaskTest.java @@ -117,11 +117,10 @@ public class TaskTest { Assume.assumeNoException(e); } }); - System.out.println("Start"); Assert.assertFalse("Task should fail because we have cancelled it", executor.test()); Thread.sleep(3000); - Assert.assertNull("CancellationException should not be recorded.", executor.getException()); - Assert.assertNull("CancellationException should not be recorded.", task.getException()); + Assert.assertTrue("CancellationException should not be recorded.", executor.getException() instanceof CancellationException); + Assert.assertTrue("CancellationException should not be recorded.", task.getException() instanceof CancellationException); Assert.assertTrue("Thread.sleep cannot be interrupted", flag.get()); }