Lines Matching refs:task
43 protected final ListenableFutureTask<Integer> task =
62 task.addListener(new Runnable() {
83 assertFalse(task.isDone());
84 assertFalse(task.isCancelled());
86 // Start the task to put it in the RUNNING state. Have to use a separate
87 // thread because the task will block on the task latch after unblocking
89 exec.execute(task);
92 assertFalse(task.isDone());
93 assertFalse(task.isCancelled());
95 // Finish the task by unblocking the task latch. Then wait for the
98 assertEquals(25, task.get().intValue());
100 assertTrue(task.isDone());
101 assertFalse(task.isCancelled());
107 // Start up the task and unblock the latch to finish the task.
108 exec.execute(task);
113 task.get(5, TimeUnit.SECONDS);
120 assertTrue(task.isDone());
121 assertFalse(task.isCancelled());
125 task.cancel(false);
126 assertTrue(task.isDone());
127 assertTrue(task.isCancelled());
132 assertTrue(task.isDone());
133 assertTrue(task.isCancelled());
140 exec.execute(task);
144 task.cancel(true);
145 assertTrue(task.isDone());
146 assertTrue(task.isCancelled());
151 assertTrue(task.isDone());
152 assertTrue(task.isCancelled());