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

Method testPrimitives

BoltsTest/src/bolts/TaskTest.java:43–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 public void testPrimitives() {
44 Task<Integer> complete = Task.forResult(5);
45 Task<Integer> error = Task.forError(new RuntimeException());
46 Task<Integer> cancelled = Task.cancelled();
47
48 assertTrue(complete.isCompleted());
49 assertEquals(5, complete.getResult().intValue());
50 assertFalse(complete.isFaulted());
51 assertFalse(complete.isCancelled());
52
53 assertTrue(error.isCompleted());
54 assertTrue(error.getError() instanceof RuntimeException);
55 assertTrue(error.isFaulted());
56 assertFalse(error.isCancelled());
57
58 assertTrue(cancelled.isCompleted());
59 assertFalse(cancelled.isFaulted());
60 assertTrue(cancelled.isCancelled());
61 }
62
63 public void testSynchronousContinuation() {
64 final Task<Integer> complete = Task.forResult(5);

Callers

nothing calls this directly

Calls 8

forResultMethod · 0.95
forErrorMethod · 0.95
cancelledMethod · 0.95
isCompletedMethod · 0.80
getResultMethod · 0.80
isFaultedMethod · 0.80
isCancelledMethod · 0.80
getErrorMethod · 0.80

Tested by

no test coverage detected