mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
runSingleTest(Runnable) extracted for parameterized tests
This commit is contained in:
+3
-9
@@ -44,18 +44,12 @@ public abstract class LightQuickFixParameterizedTestCase extends LightQuickFixTe
|
||||
@SuppressWarnings("JUnit4AnnotatedMethodInJUnit3TestCase")
|
||||
@Test
|
||||
public void runSingle() throws Throwable {
|
||||
final Throwable[] throwables = new Throwable[1];
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
runSingleTest(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
doSingleTest(myFileSuffix, myTestDataPath);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
throwables[0] = e;
|
||||
}
|
||||
doSingleTest(myFileSuffix, myTestDataPath);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
invokeTestRunnable(runnable);
|
||||
|
||||
+23
@@ -747,4 +747,27 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
|
||||
}
|
||||
}
|
||||
|
||||
protected void runSingleTest(Runnable testRunnable) throws Throwable {
|
||||
final Throwable[] throwables = new Throwable[1];
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
testRunnable.run();
|
||||
}
|
||||
catch (Throwable e) {
|
||||
throwables[0] = e;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
invokeTestRunnable(runnable);
|
||||
|
||||
if (throwables[0] != null) {
|
||||
throw throwables[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user