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
-
Field Summary
Fields inherited from class com.google.common.util.concurrent.testing.AbstractListenableFutureTest
future, latch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Checks that the exception is the correct type of cancellation exception.protected abstract void
Checks that the exception is the correct type of execution exception.protected abstract void
Checks that the exception is the correct type of interruption exception.protected abstract <V> CheckedFuture
<V, ?> createCheckedFuture
(V value, Exception except, CountDownLatch waitOn) More specific type for the create method.protected <V> ListenableFuture
<V> createListenableFuture
(V value, Exception except, CountDownLatch waitOn) Constructs a listenable future with a value available after the latch has counted down.void
Tests that theCheckedFuture.checkedGet()
method throws the correct type of cancellation exception when it is cancelled.void
void
Methods inherited from class com.google.common.util.concurrent.testing.AbstractListenableFutureTest
setUp, tearDown, testAllListenersCompleteSuccessfully, testCanceledFutureThrowsCancellation, testGetBlocksUntilValueAvailable, testListenersNotifiedOnError, testTimeoutOnGetWorksCorrectly
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
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
Checks that the exception is the correct type of cancellation exception. -
checkExecutionException
Checks that the exception is the correct type of execution exception. -
checkInterruptedException
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 classAbstractListenableFutureTest
-
testCheckedGetThrowsApplicationExceptionOnCancellation
public void testCheckedGetThrowsApplicationExceptionOnCancellation()Tests that theCheckedFuture.checkedGet()
method throws the correct type of cancellation exception when it is cancelled. -
testCheckedGetThrowsApplicationExceptionOnInterruption
- Throws:
InterruptedException
-
testCheckedGetThrowsApplicationExceptionOnError
public void testCheckedGetThrowsApplicationExceptionOnError()
-