- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 433 for Future (0.06 sec)
-
guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java
List<Future<String>> futures = testExecutor.invokeAll(tasks); mock.assertLastMethodCalled("invokeAll"); checkResults(futures); } { MockExecutor mock = new MockExecutor(); TimeUnit unit = SECONDS; long timeout = 5; TestExecutor testExecutor = new TestExecutor(mock); List<Future<String>> futures = testExecutor.invokeAll(tasks, timeout, unit);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 9.9K bytes - Viewed (0) -
android/guava-testlib/test/com/google/common/util/concurrent/testing/TestingExecutorsTest.java
taskDone = true; return taskDone; } }; List<Future<Boolean>> futureList = executor.invokeAll(ImmutableList.of(task), 10, MILLISECONDS); Future<Boolean> future = futureList.get(0); assertFalse(taskDone); assertTrue(future.isDone()); assertThrows(CancellationException.class, () -> future.get()); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 3.7K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java
SettableFuture<Integer> future = SettableFuture.create(); assertTrue(future.set(42)); // Later attempts to set the future should return false. assertFalse(future.set(23)); assertFalse(future.setException(new Exception("bar"))); assertFalse(future.setFuture(SettableFuture.<Integer>create())); // Check that the future has been set properly. assertTrue(future.isDone()); assertFalse(future.isCancelled());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 7.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/QueuesTest.java
Future<?> possiblyIgnoredError = threadPool.submit(new Producer(q, 20)); @SuppressWarnings("unused") // https://errorprone.info/bugpattern/FutureReturnValueIgnored Future<?> possiblyIgnoredError1 = threadPool.submit(new Producer(q, 20)); @SuppressWarnings("unused") // https://errorprone.info/bugpattern/FutureReturnValueIgnored
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 17 02:42:09 UTC 2024 - 12.1K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java
assertFalse(future.isCancelled()); ExecutorService executor = Executors.newSingleThreadExecutor(); try { Future<Boolean> getResult = executor.submit(() -> future.get()); // Release the future value. latch.countDown(); assertTrue(getResult.get(10, SECONDS)); } finally { executor.shutdownNow(); } assertTrue(future.isDone());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Sep 06 18:30:30 UTC 2023 - 6K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java
assertTrue(future.isDone()); assertTrue(future.isCancelled()); assertThrows(CancellationException.class, () -> future.get()); } public void testFailedFuture(@Nullable String message) throws InterruptedException { assertTrue(future.isDone()); assertFalse(future.isCancelled()); assertTrue(latch.await(5, SECONDS)); assertTrue(future.isDone()); assertFalse(future.isCancelled());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 3.3K bytes - Viewed (0) -
fess-crawler/src/test/java/org/codelibs/fess/crawler/interval/impl/HostIntervalControllerTest.java
// Callableタスク(複数)を実行する final ExecutorService executor = Executors.newFixedThreadPool(numTasks); try { final List<Future<Integer>> futures = executor.invokeAll(tasks); for (final Future<Integer> future : futures) { future.get(); } } catch (final InterruptedException e) { // no thing to do } catch (final ExecutionException e) {
Registered: Sun Nov 10 03:50:12 UTC 2024 - Last Modified: Thu Feb 22 01:36:27 UTC 2024 - 3.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java
} @Override public void onFailure(Throwable t) { failureCalls[0]++; } }; addCallback(future, callback, directExecutor()); future.set(result); assertEquals(result, future.get()); assertThat(successCalls[0]).isEqualTo(1); assertThat(failureCalls[0]).isEqualTo(0); } public void testOnSuccessThrowsError() throws Exception {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 15:41:36 UTC 2024 - 6.6K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java
try { List<Future<int[]>> futures = newArrayListWithExpectedSize(nTasks); for (int i = 0; i < nTasks; i++) { futures.add(pool.submit(new MutateTask(multiset, keys))); } int[] deltas = new int[3]; for (Future<int[]> future : futures) { int[] taskDeltas = future.get(); for (int i = 0; i < deltas.length; i++) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 5.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/TestPlatform.java
} /** * Retrieves the result of a {@code Future} known to be done but uses the {@code get(long, * TimeUnit)} overload in order to test that method. */ static <V> V getDoneFromTimeoutOverload(Future<V> future) throws ExecutionException { checkState(future.isDone(), "Future was expected to be done: %s", future); try { return getUninterruptibly(future, 0, SECONDS); } catch (TimeoutException e) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 29 16:29:37 UTC 2024 - 2.6K bytes - Viewed (0)