Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.tests/src')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java87
1 files changed, 50 insertions, 37 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 483ecb774e..90cbd802ee 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
@@ -10,6 +10,7 @@
*/
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.concurrent.ConcurrencyUtil;
@@ -242,53 +243,60 @@ public abstract class AbstractOMTest extends TestCase
@Override
public void runBare() throws Throwable
{
- try
+ TestExecuter.execute(this, new TestExecuter.Executable()
{
- // Don't call super.runBare() because it does not clean up after exceptions from setUp()
- Throwable exception = null;
-
- try
- {
- setUp();
- runTest();
- }
- catch (Throwable running)
- {
- exception = running;
- }
- finally
+ public void execute() throws Throwable
{
try
{
- tearDown();
+ Throwable exception = null;
+
+ try
+ {
+ setUp();
+
+ // Don't call super.runBare() because it does not clean up after exceptions from setUp()
+ runTest();
+ }
+ catch (Throwable running)
+ {
+ exception = running;
+ }
+ finally
+ {
+ try
+ {
+ tearDown();
+ }
+ catch (Throwable tearingDown)
+ {
+ if (exception == null)
+ {
+ exception = tearingDown;
+ }
+ }
+ }
+
+ if (exception != null)
+ {
+ throw exception;
+ }
+ }
+ catch (SkipTestException ex)
+ {
+ OM.LOG.info("Skipped " + this); //$NON-NLS-1$
}
- catch (Throwable tearingDown)
+ catch (Throwable t)
{
- if (exception == null)
+ if (!SUPPRESS_OUTPUT)
{
- exception = tearingDown;
+ t.printStackTrace(IOUtil.OUT());
}
- }
- }
- if (exception != null)
- {
- throw exception;
- }
- }
- catch (SkipTestException ex)
- {
- OM.LOG.info("Skipped " + this); //$NON-NLS-1$
- }
- catch (Throwable t)
- {
- if (!SUPPRESS_OUTPUT)
- {
- t.printStackTrace(IOUtil.OUT());
+ throw t;
+ }
}
-
- throw t;
- }
+ });
}
@Override
@@ -422,6 +430,11 @@ public abstract class AbstractOMTest extends TestCase
return file;
}
+ public static AbstractOMTest getCurrrentTest()
+ {
+ return (AbstractOMTest)TestExecuter.getValue();
+ }
+
/**
* @deprecated Use assertEquals(message, true, ...)
*/

Back to the top