@Beta public final class TestingExecutors extends Object
ExecutorService
for testing.Modifier and Type | Method and Description |
---|---|
static com.google.common.util.concurrent.ListeningScheduledExecutorService |
noOpScheduledExecutor()
Returns a
ScheduledExecutorService that never executes anything. |
public static com.google.common.util.concurrent.ListeningScheduledExecutorService noOpScheduledExecutor()
ScheduledExecutorService
that never executes anything.
The shutdownNow
method of the returned executor always returns an empty list despite
the fact that everything is still technically awaiting execution.
The getDelay
method of any ScheduledFuture
returned by the executor will always
return the max long value instead of the time until the user-specified delay.
Copyright © 2010-2013. All Rights Reserved.