Searched refs:future (Results 1 - 25 of 144) sorted by relevance

123456

/external/guava/guava-tests/test/com/google/common/util/concurrent/
H A DListenableFutureTester.java32 * Used to test listenable future implementations.
39 private final ListenableFuture<?> future; field in class:ListenableFutureTester
42 public ListenableFutureTester(ListenableFuture<?> future) { argument
44 this.future = future;
49 future.addListener(new Runnable() {
56 assertFalse(future.isDone());
57 assertFalse(future.isCancelled());
66 assertTrue(future.isDone());
67 assertFalse(future
[all...]
H A DAbstractFutureTest.java47 AbstractFuture<String> future = new AbstractFuture<String>() {
53 ExecutionException ee1 = getExpectingExecutionException(future);
54 ExecutionException ee2 = getExpectingExecutionException(future);
67 InterruptibleFuture future = new InterruptibleFuture();
68 assertTrue(future.cancel(false));
69 assertTrue(future.isCancelled());
70 assertTrue(future.isDone());
71 assertFalse(future.wasInterrupted);
75 InterruptibleFuture future = new InterruptibleFuture();
76 assertTrue(future
165 getExpectingExecutionException( AbstractFuture<String> future) argument
[all...]
H A DSettableFutureTest.java31 private SettableFuture<String> future; field in class:SettableFutureTest
38 future = SettableFuture.create();
39 tester = new ListenableFutureTester(future);
45 future.get(5, TimeUnit.MILLISECONDS);
51 assertTrue(future.set("value"));
56 assertTrue(future.setException(new Exception("failure")));
62 future.setException(null);
66 assertFalse(future.isDone());
67 assertTrue(future.setException(new Exception("failure")));
72 assertTrue(future
[all...]
H A DMoreExecutorsTest.java72 Future<?> future = executor.submit(incrementTask);
73 assertTrue(future.isDone());
83 ListenableFuture<?> future = executor.submit(incrementTask);
84 assertTrue(future.isDone());
85 assertListenerRunImmediately(future);
117 Future<Integer> future = futures.get(i);
118 assertTrue("Task should have been run before being returned", future.isDone());
119 assertEquals(i, future.get().intValue());
139 Future<?> future = executor.submit(new Callable<Void>() {
155 assertTrue(future
225 assertListenerRunImmediately(ListenableFuture<?> future) argument
[all...]
H A DFuturesTest.java85 * Clear interrupt for future tests.
96 ListenableFuture<String> future = Futures.immediateFuture(DATA1);
99 assertSame(DATA1, future.get(0L, TimeUnit.MILLISECONDS));
113 ListenableFuture<String> future =
117 future.get(0L, TimeUnit.MILLISECONDS);
128 CheckedFuture<String, MyException> future = Futures.immediateCheckedFuture(
132 assertSame(DATA1, future.get(0L, TimeUnit.MILLISECONDS));
133 assertSame(DATA1, future.checkedGet(0L, TimeUnit.MILLISECONDS));
151 CheckedFuture<String, MyException> future =
155 future
728 final ListenableFuture<String> future; field in class:FuturesTest.TestFuture
732 TestFuture( ListenableFuture<String> future, String name, Runnable finisher) argument
1079 conditionalPseudoTimedGet( TestFutureBatch inputs, ListenableFuture<String> iFuture, ListenableFuture<String> jFuture, ListenableFuture<List<String>> future, int timeout, TimeUnit unit) argument
[all...]
/external/guava/guava-testlib/src/com/google/common/util/concurrent/testing/
H A DAbstractCheckedFutureTest.java70 final CheckedFuture<Boolean, ?> future =
73 assertFalse(future.isDone());
74 assertFalse(future.isCancelled());
79 future.cancel(true);
84 future.checkedGet();
90 assertTrue(future.isDone());
91 assertTrue(future.isCancelled());
97 final CheckedFuture<Boolean, ?> future =
103 assertFalse(future.isDone());
104 assertFalse(future
[all...]
H A DAbstractListenableFutureTest.java44 protected ListenableFuture<Boolean> future; field in class:AbstractListenableFutureTest
49 // Create a latch and a future that waits on the latch.
51 future = createListenableFuture(Boolean.TRUE, null, latch);
62 * Constructs a listenable future with a value available after the latch
74 assertFalse(future.isDone());
75 assertFalse(future.isCancelled());
80 // Wait on the future in a separate thread.
85 assertSame(Boolean.TRUE, future.get());
93 // Release the future value.
102 assertTrue(future
[all...]
H A DMockFutureListener.java39 private final ListenableFuture<?> future; field in class:MockFutureListener
41 public MockFutureListener(ListenableFuture<?> future) { argument
43 this.future = future;
45 future.addListener(this, MoreExecutors.sameThreadExecutor());
55 * Asserts that the future returns the expected data.
64 Assert.assertEquals(expectedData, future.get());
72 * Asserts that the future throws an {@code ExecutableException} and that the
80 future.get();
/external/chromium_org/chrome/common/extensions/docs/server2/
H A Dfuture_test.py9 from future import Future
16 future = Future(value=42)
17 self.assertEqual(42, future.Get())
18 self.assertEqual(42, future.Get())
30 future = Future(delegate=delegate())
31 self.assertEqual(42, future.Get())
32 self.assertEqual(42, future.Get())
60 def assert_raises_full_stack(future, err):
62 future.Get()
69 future
[all...]
H A Dpersistent_object_store.py8 from future import Future
19 return dict((key, future.get_result().GetValue())
20 for key, future in self._futures.iteritems()
21 if future.get_result() is not None)
37 [future.wait() for future in futures]
50 [future.wait() for future in futures]
H A Ddirectory_zipper.py34 for file_name, future in futures_with_name:
35 file_contents = future.Get()
H A Dempty_dir_file_system.py6 from future import Future
H A Doffline_file_system.py6 from future import Gettable, Future
H A Dmock_file_system_test.py40 future = fs.ReadSingle('apps/')
42 future.Get()
47 future = fs.ReadSingle('apps/')
49 future.Get()
60 future = fs.Read(['notfound.html', 'apps/'])
62 self.assertRaises(FileNotFoundError, future.Get)
H A Dapi_models.py11 from future import Gettable, Future
68 for future in futures:
70 return future.Get()
/external/robolectric/src/test/java/com/xtremelabs/robolectric/util/
H A DRobolectricBackgroundExecutorServiceTest.java47 Future<String> future = executorService.submit(runnable, "foo");
50 assertFalse(future.isDone());
54 assertTrue(future.isDone());
56 assertEquals("foo", future.get());
61 Future<String> future = executorService.submit(new Callable<String>() {
69 assertFalse(future.isDone());
73 assertTrue(future.isDone());
75 assertEquals("foo", future.get());
/external/guava/guava-tests/test/com/google/common/testing/
H A DGcFinalizationTest.java39 final SettableFuture<Void> future = SettableFuture.create();
41 protected void finalize() { future.set(null); }
44 GcFinalization.awaitDone(future);
45 assertTrue(future.isDone());
46 assertFalse(future.isCancelled());
50 final SettableFuture<Void> future = SettableFuture.create();
52 protected void finalize() { future.cancel(false); }
55 GcFinalization.awaitDone(future);
56 assertTrue(future.isDone());
57 assertTrue(future
[all...]
/external/guava/guava/src/com/google/common/util/concurrent/
H A DJdkFutureAdapters.java45 * <p><b>Warning:</b> If the input future does not already implement {@link
46 * ListenableFuture}, the returned future will emulate {@link
49 * until the future is {@linkplain Future#isDone() done}.
59 Future<V> future) {
60 if (future instanceof ListenableFuture<?>) {
61 return (ListenableFuture<V>) future;
63 return new ListenableFutureAdapter<V>(future);
68 Future<V> future, Executor executor) {
70 if (future instanceof ListenableFuture<?>) {
71 return (ListenableFuture<V>) future;
58 listenInPoolThread( Future<V> future) argument
67 listenInPoolThread( Future<V> future, Executor executor) argument
[all...]
H A DFutures.java80 ListenableFuture<V> future, Function<Exception, X> mapper) {
81 return new MappingCheckedFuture<V, X>(checkNotNull(future), mapper);
91 SettableFuture<V> future = SettableFuture.create();
92 future.set(value);
93 return future;
106 SettableFuture<V> future = SettableFuture.create();
107 future.set(value);
108 return Futures.makeChecked(future, new Function<Exception, X>() {
130 SettableFuture<V> future = SettableFuture.create();
131 future
79 makeChecked( ListenableFuture<V> future, Function<Exception, X> mapper) argument
444 transform(ListenableFuture<I> future, final Function<? super I, ? extends O> function) argument
497 transform(ListenableFuture<I> future, final Function<? super I, ? extends O> function, Executor executor) argument
534 lazyTransform(final Future<I> future, final Function<? super I, ? extends O> function) argument
704 cancel(@ullable Future<?> future, boolean mayInterruptIfRunning) argument
913 addCallback(ListenableFuture<V> future, FutureCallback<? super V> callback) argument
965 addCallback(final ListenableFuture<V> future, final FutureCallback<? super V> callback, Executor executor) argument
1036 get( Future<V> future, Class<X> exceptionClass) argument
1102 get( Future<V> future, long timeout, TimeUnit unit, Class<X> exceptionClass) argument
1172 getUnchecked(Future<V> future) argument
1352 setOneValue(int index, Future<? extends V> future) argument
[all...]
/external/robolectric/src/test/java/com/xtremelabs/robolectric/shadows/
H A DAccountManagerTest.java45 AccountManagerFuture<Bundle> future =
48 assertThat(future.isCancelled(), equalTo(false));
49 future.cancel(true);
50 assertThat(future.isCancelled(), equalTo(true));
55 AccountManagerFuture<Bundle> future =
58 assertThat(future.isDone(), equalTo(false));
59 future.cancel(true);
60 assertThat(future.isDone(), equalTo(true));
65 AccountManagerFuture<Bundle> future =
68 assertThat(future
[all...]
/external/robolectric/src/main/java/com/xtremelabs/robolectric/shadows/
H A DShadowAsyncTask.java22 private final FutureTask<Result> future; field in class:ShadowAsyncTask
28 future = new FutureTask<Result>(worker) {
57 return future.isCancelled();
62 return future.cancel(mayInterruptIfRunning);
67 return future.get();
72 return future.get(timeout, unit);
84 future.run();
/external/chromium_org/android_webview/javatests/src/org/chromium/android_webview/test/
H A DWebViewFindApisTestBase.java73 final IntegerFuture future = new IntegerFuture() {
86 runTestOnUiThread(future);
87 return future.get(10, TimeUnit.SECONDS);
101 final IntegerFuture future = new IntegerFuture() {
114 runTestOnUiThread(future);
115 return future.get(10, TimeUnit.SECONDS);
/external/smack/src/org/jivesoftware/smackx/filetransfer/
H A DFaultTolerantNegotiator.java94 Future<InputStream> future;
97 future = service.poll(10, TimeUnit.SECONDS);
103 if (future == null) {
108 stream = future.get();
119 for (Future<InputStream> future : futures) {
120 future.cancel(true);
/external/clang/test/SemaCXX/
H A Dlinkage2.cpp61 class future { class in namespace:test6
65 template <class _Rp> future<_Rp>
69 shared_future(future<_Rp&>&& __f);
/external/zxing/qr_scanner/src/com/google/zxing/client/android/
H A DInactivityTimer.java75 ScheduledFuture<?> future = inactivityFuture;
76 if (future != null) {
77 future.cancel(true);

Completed in 753 milliseconds

123456