@Beta public abstract class AbstractCheckedFutureTest extends AbstractListenableFutureTest
Test case to make sure the CheckedFuture.checkedGet() and CheckedFuture.checkedGet(long, TimeUnit) methods work correctly.
future, latch| Constructor and Description |
|---|
AbstractCheckedFutureTest() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
checkCancelledException(Exception e)
Checks that the exception is the correct type of cancellation exception.
|
protected abstract void |
checkExecutionException(Exception e)
Checks that the exception is the correct type of execution exception.
|
protected abstract void |
checkInterruptedException(Exception e)
Checks that the exception is the correct type of interruption exception.
|
protected abstract <V> com.diffplug.common.util.concurrent.CheckedFuture<V,?> |
createCheckedFuture(V value,
Exception except,
CountDownLatch waitOn)
More specific type for the create method.
|
protected <V> com.diffplug.common.util.concurrent.ListenableFuture<V> |
createListenableFuture(V value,
Exception except,
CountDownLatch waitOn)
Constructs a listenable future with a value available after the latch has counted down.
|
void |
testCheckedGetThrowsApplicationExceptionOnCancellation()
Tests that the
CheckedFuture.checkedGet() method throws the correct type of cancellation exception when it is cancelled. |
void |
testCheckedGetThrowsApplicationExceptionOnError() |
void |
testCheckedGetThrowsApplicationExceptionOnInterruption() |
setUp, tearDown, testAllListenersCompleteSuccessfully, testCanceledFutureThrowsCancellation, testGetBlocksUntilValueAvailable, testListenersNotifiedOnError, testTimeoutOnGetWorksCorrectlyassertEquals, 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, toStringprotected abstract <V> com.diffplug.common.util.concurrent.CheckedFuture<V,?> createCheckedFuture(V value, Exception except, CountDownLatch waitOn)
More specific type for the create method.
protected abstract void checkCancelledException(Exception e)
Checks that the exception is the correct type of cancellation exception.
protected abstract void checkExecutionException(Exception e)
Checks that the exception is the correct type of execution exception.
protected abstract void checkInterruptedException(Exception e)
Checks that the exception is the correct type of interruption exception.
protected <V> com.diffplug.common.util.concurrent.ListenableFuture<V> createListenableFuture(V value, Exception except, CountDownLatch waitOn)
AbstractListenableFutureTestConstructs a listenable future with a value available after the latch has counted down.
createListenableFuture in class AbstractListenableFutureTestpublic void testCheckedGetThrowsApplicationExceptionOnCancellation()
Tests that the CheckedFuture.checkedGet() method throws the correct type of cancellation exception when it is cancelled.
public void testCheckedGetThrowsApplicationExceptionOnInterruption()
throws InterruptedException
InterruptedExceptionpublic void testCheckedGetThrowsApplicationExceptionOnError()