mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UsefulTestCase.edt: explicitly rethrow the exception
This is already done in invokeAndWaitIfNeeded via LOG.error, but making it more explicit won't hurt, especially if LOG.error stops throwing exception in tests. Also accept ThrowableRunnable.
This commit is contained in:
@@ -348,13 +348,29 @@ public abstract class UsefulTestCase extends TestCase {
|
||||
return PlatformTestUtil.canRunTest(getClass());
|
||||
}
|
||||
|
||||
public static void edt(Runnable r) {
|
||||
UIUtil.invokeAndWaitIfNeeded(r);
|
||||
public static void edt(@NotNull final ThrowableRunnable r) {
|
||||
try {
|
||||
UIUtil.invokeAndWaitIfNeeded(r);
|
||||
}
|
||||
catch (RuntimeException re) {
|
||||
throw re;
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
throw new RuntimeException(throwable);
|
||||
}
|
||||
}
|
||||
|
||||
public static void edt(@NotNull final Runnable r) {
|
||||
edt(new ThrowableRunnable() {
|
||||
@Override
|
||||
public void run() throws Throwable {
|
||||
r.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception {
|
||||
UIUtil.invokeAndWaitIfNeeded(runnable);
|
||||
//runnable.run();
|
||||
edt(runnable);
|
||||
}
|
||||
|
||||
protected void defaultRunBare() throws Throwable {
|
||||
|
||||
Reference in New Issue
Block a user