public abstract class FutureTestTemplate<T,I> extends Object
| Modifier and Type | Field and Description |
|---|---|
private ExecutorService |
executor |
private long |
maxTimeWaitTermination |
private long |
taskTimeout |
private Future<T> |
testFuture |
| Constructor and Description |
|---|
FutureTestTemplate() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Future<T> |
createTestFuture(Future<I> innerFuture) |
protected Future<T> |
getTestFuture() |
protected void |
set_up() |
protected void |
tear_down() |
protected void |
test_cancel_ifTaskIsFinished() |
protected void |
test_cancel_ifTaskIsRunning() |
protected T |
test_get(I innerFutureGetResult) |
protected void |
test_getWithTimeout_ifWaitTimeElapsed(I innerFutureGetResult) |
protected T |
test_getWithTimeout(I innerFutureGetResult) |
private ExecutorService executor
private long maxTimeWaitTermination
private long taskTimeout
protected void set_up()
protected void tear_down()
throws InterruptedException
InterruptedExceptionprotected void test_cancel_ifTaskIsFinished()
throws InterruptedException,
ExecutionException
protected void test_cancel_ifTaskIsRunning()
protected T test_get(I innerFutureGetResult) throws InterruptedException, ExecutionException
protected T test_getWithTimeout(I innerFutureGetResult) throws InterruptedException, ExecutionException, TimeoutException
protected void test_getWithTimeout_ifWaitTimeElapsed(I innerFutureGetResult) throws InterruptedException, ExecutionException, TimeoutException