Refactor Task

This commit is contained in:
huanghongxun
2019-02-24 23:09:17 +08:00
parent dc1df98277
commit 8f2a1030bc
72 changed files with 841 additions and 935 deletions

View File

@@ -0,0 +1,18 @@
package org.jackhuang.hmcl.util;
import org.jackhuang.hmcl.task.Task;
import org.junit.Assert;
import org.junit.Test;
public class TaskTest {
@Test
public void testWhenComplete() {
Task.composeAsync(() -> Task.allOf(
Task.allOf(Task.runAsync(() -> {
throw new Exception();
}))
)).whenComplete(((isDependentSucceeded, exception) -> {
Assert.assertFalse(isDependentSucceeded);
})).test();
}
}