public abstract class MultithreadedTestUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MultithreadedTestUtil.RepeatingTestThread
A test thread that performs a repeating operation.
|
static class |
MultithreadedTestUtil.TestContext |
static class |
MultithreadedTestUtil.TestThread
A thread that can be added to a test context, and properly passes exceptions through.
|
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
MultithreadedTestUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
assertOnFutures(List<Future<?>> threadResults)
Verify that no assertions have failed inside a future.
|
private static final org.slf4j.Logger LOG
public MultithreadedTestUtil()
public static void assertOnFutures(List<Future<?>> threadResults) throws InterruptedException, ExecutionException
List<Future<Void>> results = Lists.newArrayList(); Future<Void> f = executor.submit(new Callable<Void> { public Void call() { assertTrue(someMethod()); } }); results.add(f); assertOnFutures(results);
threadResults
- A list of futuresInterruptedException
- If interrupted when waiting for a result from one of the futuresExecutionException
- If an exception other than AssertionError occurs inside any of the
futuresCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.