I would change this catch-block to use a SharedErrorCollector. Add this rule:
```
@Rule
public SharedErrorCollector errorCollector = new SharedErrorCollector();
```
And then in any catch-block use this:
```
errorCollector.addError(e);
```
The errorCollector can be used from any thread in any dunit VM. After the test 
method executes, the errorCollector will fail with every stack that was added 
to it.

If you want the test to fail sooner, then you still need to rethrow or 
set-and-check a volatile. You could use ExecutorServiceRule which is just an 
ExecutorService that invokes shutdownNow in the tearDown. Then you could return 
a Future to the test method. If the Runnable throws Error/Runtime or Callable 
throws anything then any calls to Future get() should rethrow it wrapped in an 
ExecutionException.

[ Full content available at: https://github.com/apache/geode/pull/3075 ]
This message was relayed via gitbox.apache.org for 
[email protected]

Reply via email to