Package org.apache.hadoop.hbase
Class MultithreadedTestUtil
java.lang.Object
org.apache.hadoop.hbase.MultithreadedTestUtil
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A test thread that performs a repeating operation.static class
static class
A thread that can be added to a test context, and properly passes exceptions through. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertOnFutures
(List<Future<?>> threadResults) Verify that no assertions have failed inside a future.
-
Field Details
-
LOG
-
-
Constructor Details
-
MultithreadedTestUtil
public MultithreadedTestUtil()
-
-
Method Details
-
assertOnFutures
public static void assertOnFutures(List<Future<?>> threadResults) throws InterruptedException, ExecutionException Verify that no assertions have failed inside a future. Used for unit tests that spawn threads. E.g.,List<Future<Void>> results = Lists.newArrayList(); Future<Void> f = executor.submit(new Callable<Void> { public Void call() { assertTrue(someMethod()); } }); results.add(f); assertOnFutures(results);
- Parameters:
threadResults
- A list of futures- Throws:
InterruptedException
- If interrupted when waiting for a result from one of the futuresExecutionException
- If an exception other than AssertionError occurs inside any of the futures
-