Package com.google.common.util.concurrent.FuturesTest

Examples of com.google.common.util.concurrent.FuturesTest.ExecutorSpy


  public void testListenInPoolThreadIgnoresExecutorWhenDelegateIsDone()
      throws Exception {
    NonListenableSettableFuture<String> abstractFuture =
        NonListenableSettableFuture.create();
    abstractFuture.set(DATA1);
    ExecutorSpy spy = new ExecutorSpy(directExecutor());
    ListenableFuture<String> listenableFuture =
        listenInPoolThread(abstractFuture, spy);

    SingleCallListener singleCallListener = new SingleCallListener();
    singleCallListener.expectCall();
View Full Code Here


  public void testListenInPoolThreadUsesGivenExecutor() throws Exception {
    ExecutorService executorService = newCachedThreadPool(
        new ThreadFactoryBuilder().setDaemon(true).build());
    NonListenableSettableFuture<String> abstractFuture =
        NonListenableSettableFuture.create();
    ExecutorSpy spy = new ExecutorSpy(executorService);
    ListenableFuture<String> listenableFuture =
        listenInPoolThread(abstractFuture, spy);

    SingleCallListener singleCallListener = new SingleCallListener();
    singleCallListener.expectCall();
View Full Code Here

  public void testListenInPoolThreadIgnoresExecutorWhenDelegateIsDone()
      throws Exception {
    NonListenableSettableFuture<String> abstractFuture =
        NonListenableSettableFuture.create();
    abstractFuture.set(DATA1);
    ExecutorSpy spy = new ExecutorSpy(sameThreadExecutor());
    ListenableFuture<String> listenableFuture =
        listenInPoolThread(abstractFuture, spy);

    SingleCallListener singleCallListener = new SingleCallListener();
    singleCallListener.expectCall();
View Full Code Here

  public void testListenInPoolThreadUsesGivenExecutor() throws Exception {
    ExecutorService executorService = newCachedThreadPool(
        new ThreadFactoryBuilder().setDaemon(true).build());
    NonListenableSettableFuture<String> abstractFuture =
        NonListenableSettableFuture.create();
    ExecutorSpy spy = new ExecutorSpy(executorService);
    ListenableFuture<String> listenableFuture =
        listenInPoolThread(abstractFuture, spy);

    SingleCallListener singleCallListener = new SingleCallListener();
    singleCallListener.expectCall();
View Full Code Here

TOP

Related Classes of com.google.common.util.concurrent.FuturesTest.ExecutorSpy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.