Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-04-24 23:36:37 -0400
committerEike Stepper2018-04-24 23:36:37 -0400
commitb1cf5c385c916946ea044f0325b74b3907c262ed (patch)
tree5a60268564f4f3fe6272b638f2d4c4970f0aa2a0 /plugins/org.eclipse.net4j.tests/src/org
parentd3d54f27b1c256e2416c4cd0e873d2764b5edcaf (diff)
downloadcdo-b1cf5c385c916946ea044f0325b74b3907c262ed.tar.gz
cdo-b1cf5c385c916946ea044f0325b74b3907c262ed.tar.xz
cdo-b1cf5c385c916946ea044f0325b74b3907c262ed.zip
[Releng] Provide AbstractOMTest.await(CountDownLatch) helper
Diffstat (limited to 'plugins/org.eclipse.net4j.tests/src/org')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java20
1 files changed, 17 insertions, 3 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 aea3b9e3e1..52c7d0e029 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
@@ -13,7 +13,9 @@ package org.eclipse.net4j.util.tests;
import org.eclipse.net4j.internal.util.test.TestExecuter;
import org.eclipse.net4j.tests.bundle.OM;
import org.eclipse.net4j.util.ReflectUtil;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.concurrent.TimeoutRuntimeException;
import org.eclipse.net4j.util.concurrent.TrackableTimerTask;
import org.eclipse.net4j.util.event.EventUtil;
import org.eclipse.net4j.util.event.IEvent;
@@ -857,11 +859,23 @@ public abstract class AbstractOMTest extends TestCase
});
}
- public static final void await(CountDownLatch latch) throws InterruptedException, TimeoutException
+ public static void await(CountDownLatch latch) throws TimeoutRuntimeException
{
- if (!latch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS))
+ await(latch, DEFAULT_TIMEOUT);
+ }
+
+ public static void await(CountDownLatch latch, long millis) throws TimeoutRuntimeException
+ {
+ try
+ {
+ if (!latch.await(millis, TimeUnit.MILLISECONDS))
+ {
+ throw new TimeoutRuntimeException("Latch timed out: " + latch);
+ }
+ }
+ catch (InterruptedException ex)
{
- throw new TimeoutException("Latch timed out: " + latch);
+ throw WrappedException.wrap(ex);
}
}

Back to the top