@Beta @GwtIncompatible public class MockFutureListener extends Object implements Runnable
Runnable
that can be used for testing ListenableFutures.Constructor and Description |
---|
MockFutureListener(ListenableFuture<?> future) |
Modifier and Type | Method and Description |
---|---|
void |
assertException(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(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 assertSuccess(Object expectedData) throws Throwable
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(Throwable expectedCause) throws Exception
ExecutableException
and that the cause of the ExecutableException
is
expectedCause
.Exception
Copyright © 2010–2019. All rights reserved.