HomeSort by relevance Sort by last modified time
    Searched defs:future (Results 1 - 25 of 50) sorted by null

1 2

  /external/guava/guava-tests/test/com/google/common/util/concurrent/
ListenableFutureTester.java 32 * Used to test listenable future implementations.
39 private final ListenableFuture<?> future; field in class:ListenableFutureTester
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())
    [all...]
SettableFutureTest.java 31 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.cancel(true))
    [all...]
AbstractFutureTest.java 47 AbstractFuture<String> future = new AbstractFuture<String>() { local
53 ExecutionException ee1 = getExpectingExecutionException(future);
54 ExecutionException ee2 = getExpectingExecutionException(future);
67 InterruptibleFuture future = new InterruptibleFuture(); local
68 assertTrue(future.cancel(false));
69 assertTrue(future.isCancelled());
70 assertTrue(future.isDone());
71 assertFalse(future.wasInterrupted);
75 InterruptibleFuture future = new InterruptibleFuture(); local
76 assertTrue(future.cancel(true))
83 AbstractFuture<String> future = new AbstractFuture<String>() { local
96 final AbstractFuture<String> future = new AbstractFuture<String>() {}; local
    [all...]
MoreExecutorsTest.java 35 import java.util.concurrent.Future;
72 Future<?> future = executor.submit(incrementTask);
73 assertTrue(future.isDone());
83 ListenableFuture<?> future = executor.submit(incrementTask); local
84 assertTrue(future.isDone());
85 assertListenerRunImmediately(future);
113 List<Future<Integer>> futures =
117 Future<Integer> future = futures.get(i) local
    [all...]
AbstractListeningExecutorServiceTest.java 29 import java.util.concurrent.Future;
61 Future<?> future = e.submit(task); local
62 future.get();
71 Future<String> future = e.submit(new StringTask()); local
72 String result = future.get();
81 Future<?> future = e.submit(new NoOpRunnable()); local
82 future.get()
91 Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING); local
    [all...]
AbstractScheduledServiceTest.java 27 import java.util.concurrent.Future;
45 volatile ScheduledFuture<?> future = null; field in class:AbstractScheduledServiceTest
55 return future = super.scheduleWithFixedDelay(command, initialDelay, delay, unit);
62 assertFalse(future.isDone());
64 assertTrue(future.isCancelled());
82 future.get();
304 Future<?> future = scheduler.schedule(null, Executors.newScheduledThreadPool(10), task); local
312 future.cancel(false);
  /external/guava/guava-testlib/src/com/google/common/util/concurrent/testing/
MockFutureListener.java 39 private final ListenableFuture<?> future; field in class:MockFutureListener
41 public MockFutureListener(ListenableFuture<?> future) {
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();
AbstractCheckedFutureTest.java 70 final CheckedFuture<Boolean, ?> future = local
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 = local
103 assertFalse(future.isDone());
104 assertFalse(future.isCancelled())
134 final CheckedFuture<Boolean, ?> future = local
    [all...]
AbstractListenableFutureTest.java 29 import java.util.concurrent.Future;
44 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
69 * Tests that the {@link Future#get()} method blocks until a value is
74 assertFalse(future.isDone());
75 assertFalse(future.isCancelled());
80 // Wait on the future in a separate thread.
85 assertSame(Boolean.TRUE, future.get())
    [all...]
  /external/guava/guava/src/com/google/common/util/concurrent/
Futures.java 47 import java.util.concurrent.Future;
56 * Static utility methods pertaining to the {@link Future} interface.
75 * See {@link Future#get()} for details on the exceptions thrown.
80 ListenableFuture<V> future, Function<Exception, X> mapper) {
81 return new MappingCheckedFuture<V, X>(checkNotNull(future), mapper);
86 * construction. The getters just return the value. This {@code Future} can't
91 SettableFuture<V> future = SettableFuture.create(); local
92 future.set(value);
93 return future;
100 * <p>The returned {@code Future} can't be cancelled, and its {@code isDone()
106 SettableFuture<V> future = SettableFuture.create(); local
    [all...]
SimpleTimeLimiter.java 35 import java.util.concurrent.Future;
126 Future<T> future = executor.submit(callable); local
130 return future.get(timeoutDuration, timeoutUnit);
132 future.cancel(true);
136 return Uninterruptibles.getUninterruptibly(future,
142 future.cancel(true);
  /frameworks/ex/variablespeed/tests/src/com/android/ex/variablespeed/
RealMediaPlayerTest.java 40 FutureTask<MediaPlayer> future = new FutureTask<MediaPlayer>(callable); local
41 getInstrumentation().runOnMainSync(future);
42 return DynamicProxy.dynamicProxy(MediaPlayerProxy.class, future.get(1, TimeUnit.SECONDS));
  /packages/apps/Email/tests/src/com/android/email/
AccountTestCase.java 85 AccountManagerFuture<Boolean> future = local
88 future.getResult();
  /external/chromium/chrome/browser/safe_browsing/
protocol_manager_unittest.cc 115 Time future = now + TimeDelta::FromMinutes(1); local
116 EXPECT_TRUE(pm.next_gethash_time_ >= future - margin &&
117 pm.next_gethash_time_ <= future + margin);
safe_browsing_store_unittest.cc 263 const base::Time future = now + base::TimeDelta::FromDays(3*365); local
266 EXPECT_GT(static_cast<int32>(future.ToTimeT()), 0)
  /frameworks/support/volley/src/com/android/volley/toolbox/
AndroidAuthenticator.java 59 AccountManagerFuture<Bundle> future = accountManager.getAuthToken(mAccount, local
63 result = future.getResult();
68 if (future.isDone() && !future.isCancelled()) {
  /external/guava/guava-tests/test/com/google/common/testing/
GcFinalizationTest.java 39 final SettableFuture<Void> future = SettableFuture.create(); local
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(); local
52 protected void finalize() { future.cancel(false); }
55 GcFinalization.awaitDone(future);
56 assertTrue(future.isDone());
57 assertTrue(future.isCancelled())
130 final SettableFuture<Void> future = SettableFuture.create(); local
    [all...]
  /frameworks/base/libs/usb/src/com/android/future/usb/
UsbAccessory.java 17 package com.android.future.usb;
UsbManager.java 18 package com.android.future.usb;
  /packages/apps/Exchange/exchange2/tests/src/com/android/exchange/
CalendarSyncEnablerTest.java 251 AccountManagerFuture<Boolean> future = local
254 future.getResult();
  /packages/apps/Exchange/tests/src/com/android/exchange/
CalendarSyncEnablerTest.java 251 AccountManagerFuture<Boolean> future = local
254 future.getResult();
  /external/antlr/antlr-3.4/runtime/Ruby/lib/antlr3/
streams.rb 361 non-ASCII encoding. However, encoding-savvy recognition code is a future
904 @position = future?( 2 ) || @tokens.length
933 index = future?( k ) or return nil
946 def future?( k = 1 )
    [all...]
  /external/apache-harmony/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/
OutputStreamTesterTest.java 43 import java.util.concurrent.Future;
116 private Future<byte[]> future; field in class:OutputStreamTesterTest.PipedOutputStreamSinkTester
123 future = executor.submit(new Callable<byte[]>() {
140 return future.get();
WriterTesterTest.java 42 import java.util.concurrent.Future;
105 private Future<char[]> future; field in class:WriterTesterTest.PipedWriterCharSinkTester
112 future = executor.submit(new Callable<char[]>() {
129 return future.get();
  /external/zxing/qr_scanner/src/com/google/zxing/client/android/
InactivityTimer.java 75 ScheduledFuture<?> future = inactivityFuture; local
76 if (future != null) {
77 future.cancel(true);

Completed in 454 milliseconds

1 2