Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-08-13 16:19:08 +0000
committerEike Stepper2015-08-13 16:19:08 +0000
commit676c0d16fbc97909ca7d5eabf50c4dccba94615a (patch)
treef346369079a9da6be0b1ab59043c19bec20f6606 /plugins/org.eclipse.net4j.tests/src/org/eclipse
parent9e42d1e8f68b55e5ec227fe4039f15fb4be3fc18 (diff)
downloadcdo-676c0d16fbc97909ca7d5eabf50c4dccba94615a.tar.gz
cdo-676c0d16fbc97909ca7d5eabf50c4dccba94615a.tar.xz
cdo-676c0d16fbc97909ca7d5eabf50c4dccba94615a.zip
[474919] RecoveringExceptionHandler swallows non-transport exceptions
https://bugs.eclipse.org/bugs/show_bug.cgi?id=474919
Diffstat (limited to 'plugins/org.eclipse.net4j.tests/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
index 950d8db519..143b436b09 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
@@ -946,4 +946,53 @@ public abstract class AbstractOMTest extends TestCase
return !latch.await(timeoutMillis, TimeUnit.MILLISECONDS);
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static abstract class ThreadTimeOuter extends LatchTimeOuter implements Runnable
+ {
+ private RuntimeException exception;
+
+ public ThreadTimeOuter()
+ {
+ super(1);
+ }
+
+ @Override
+ public boolean timedOut(long timeoutMillis) throws InterruptedException
+ {
+ Thread thread = new Thread(this, "ThreadTimeOuter")
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ ThreadTimeOuter.this.run();
+ }
+ catch (RuntimeException ex)
+ {
+ exception = ex;
+ }
+ finally
+ {
+ countDown();
+ }
+ }
+ };
+
+ thread.setDaemon(true);
+ thread.start();
+
+ boolean result = super.timedOut(timeoutMillis);
+
+ if (exception != null)
+ {
+ throw exception;
+ }
+
+ return result;
+ }
+ }
}

Back to the top