MCPcopy Create free account
hub / github.com/ReadyTalk/avian / isDoneTest

Method isDoneTest

test/FutureTaskTest.java:20–36  ·  view source on GitHub ↗
(final boolean throwException)

Source from the content-addressed store, hash-verified

18 }
19
20 private static void isDoneTest(final boolean throwException) {
21 RunnableFuture<?> future = new FutureTask<Object>(new Runnable() {
22 @Override
23 public void run() {
24 if (throwException) {
25 throw new RuntimeException();
26 }
27 }
28 }, null);
29
30 // should finish the future
31 future.run();
32
33 if (! future.isDone()) {
34 throw new RuntimeException("Future should be done");
35 }
36 }
37
38 private static void getCallableResultTest() throws InterruptedException, ExecutionException {
39 final Object result = new Object();

Callers 1

mainMethod · 0.95

Calls 2

runMethod · 0.95
isDoneMethod · 0.95

Tested by

no test coverage detected