MCPcopy Index your code
hub / github.com/BoltsFramework/Bolts-Java / runTaskTest

Method runTaskTest

BoltsTest/src/bolts/TaskTest.java:25–41  ·  view source on GitHub ↗
(Callable<Task<?>> callable)

Source from the content-addressed store, hash-verified

23
24public class TaskTest extends TestCase {
25 private void runTaskTest(Callable<Task<?>> callable) {
26 try {
27 Task<?> task = callable.call();
28 task.waitForCompletion();
29 if (task.isFaulted()) {
30 Exception error = task.getError();
31 if (error instanceof RuntimeException) {
32 throw (RuntimeException) error;
33 }
34 throw new RuntimeException(error);
35 } else if (task.isCancelled()) {
36 throw new RuntimeException(new CancellationException());
37 }
38 } catch (Exception e) {
39 throw new RuntimeException(e);
40 }
41 }
42
43 public void testPrimitives() {
44 Task<Integer> complete = Task.forResult(5);

Callers 9

testBackgroundCallMethod · 0.95
testBackgroundErrorMethod · 0.95
testWhenAllSuccessMethod · 0.95
testWhenAllOneErrorMethod · 0.95
testWhenAllTwoErrorsMethod · 0.95
testWhenAllCancelMethod · 0.95
testAsyncChainingMethod · 0.95
testContinueWhileMethod · 0.95

Calls 5

waitForCompletionMethod · 0.80
isFaultedMethod · 0.80
getErrorMethod · 0.80
isCancelledMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected