Class AbstractCheckedFutureTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.google.common.util.concurrent.testing.AbstractListenableFutureTest
com.google.common.util.concurrent.testing.AbstractCheckedFutureTest
All Implemented Interfaces:
junit.framework.Test

@Beta @GwtIncompatible public abstract class AbstractCheckedFutureTest extends AbstractListenableFutureTest
Test case to make sure the CheckedFuture.checkedGet() and CheckedFuture.checkedGet(long, TimeUnit) methods work correctly.
Since:
10.0
  • Constructor Details

    • AbstractCheckedFutureTest

      public AbstractCheckedFutureTest()
  • Method Details

    • createCheckedFuture

      protected abstract <V> CheckedFuture<V,?> createCheckedFuture(V value, Exception except, CountDownLatch waitOn)
      More specific type for the create method.
    • checkCancelledException

      protected abstract void checkCancelledException(Exception e)
      Checks that the exception is the correct type of cancellation exception.
    • checkExecutionException

      protected abstract void checkExecutionException(Exception e)
      Checks that the exception is the correct type of execution exception.
    • checkInterruptedException

      protected abstract void checkInterruptedException(Exception e)
      Checks that the exception is the correct type of interruption exception.
    • createListenableFuture

      protected <V> ListenableFuture<V> createListenableFuture(V value, Exception except, CountDownLatch waitOn)
      Description copied from class: AbstractListenableFutureTest
      Constructs a listenable future with a value available after the latch has counted down.
      Specified by:
      createListenableFuture in class AbstractListenableFutureTest
    • testCheckedGetThrowsApplicationExceptionOnCancellation

      public void testCheckedGetThrowsApplicationExceptionOnCancellation()
      Tests that the CheckedFuture.checkedGet() method throws the correct type of cancellation exception when it is cancelled.
    • testCheckedGetThrowsApplicationExceptionOnInterruption

      public void testCheckedGetThrowsApplicationExceptionOnInterruption() throws InterruptedException
      Throws:
      InterruptedException
    • testCheckedGetThrowsApplicationExceptionOnError

      public void testCheckedGetThrowsApplicationExceptionOnError()