runSingleTest(Runnable) extracted for parameterized tests

This commit is contained in:
Anna Kozlova
2014-02-21 21:47:00 +01:00
parent e37b8532b5
commit 527e1de459
2 changed files with 26 additions and 9 deletions
@@ -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);
@@ -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];
}
}
}