Lines Matching refs:future
32 * Used to test listenable future implementations.
39 private final ListenableFuture<?> future;
42 public ListenableFutureTester(ListenableFuture<?> future) {
44 this.future = future;
49 future.addListener(new Runnable() {
56 assertFalse(future.isDone());
57 assertFalse(future.isCancelled());
66 assertTrue(future.isDone());
67 assertFalse(future.isCancelled());
70 assertTrue(future.isDone());
71 assertFalse(future.isCancelled());
73 assertEquals(expectedValue, future.get());
78 assertTrue(future.isDone());
79 assertTrue(future.isCancelled());
82 assertTrue(future.isDone());
83 assertTrue(future.isCancelled());
86 future.get();
87 fail("Future should throw CancellationException on cancel.");
93 assertTrue(future.isDone());
94 assertFalse(future.isCancelled());
97 assertTrue(future.isDone());
98 assertFalse(future.isCancelled());
101 future.get();
102 fail("Future should rethrow the exception.");