java.lang.Runnable@Beta @GwtIncompatible public class MockFutureListener extends java.lang.Object implements java.lang.Runnable
Runnable that can be used for
testing ListenableFutures.| Constructor | Description |
|---|---|
MockFutureListener(ListenableFuture<?> future) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
assertException(java.lang.Throwable expectedCause) |
Verify that the listener completes in a reasonable amount of time, and
Asserts that the future throws an
ExecutableException and that the
cause of the ExecutableException is expectedCause. |
void |
assertSuccess(java.lang.Object expectedData) |
Verify that the listener completes in a reasonable amount of time, and
Asserts that the future returns the expected data.
|
void |
assertTimeout() |
|
void |
run() |
public MockFutureListener(ListenableFuture<?> future)
public void run()
run in interface java.lang.Runnablepublic void assertSuccess(java.lang.Object expectedData)
throws java.lang.Throwable
java.lang.Throwable - if the listener isn't called or if it resulted in a
throwable or if the result doesn't match the expected value.public void assertException(java.lang.Throwable expectedCause)
throws java.lang.Exception
ExecutableException and that the
cause of the ExecutableException is expectedCause.java.lang.Exceptionpublic void assertTimeout()
throws java.lang.Exception
java.lang.Exception