This commit is contained in:
Vladimir Krivosheev
2016-07-18 15:33:31 +02:00
parent df72dc6675
commit cda426d779
4 changed files with 15 additions and 21 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ public abstract class LightRefactoringParameterizedTestCase extends LightRefacto
}
};
invokeTestRunnable(() -> CommandProcessor.getInstance().executeCommand(getProject(), runnable::run, "", null));
invokeTestRunnable(() -> CommandProcessor.getInstance().executeCommand(getProject(), runnable, "", null));
if (throwables[0] != null) {
throw throwables[0];
@@ -759,16 +759,14 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
protected void runSingleTest(@NotNull final Runnable testRunnable) throws Throwable {
final Throwable[] throwables = new Throwable[1];
Runnable runnable = () -> {
invokeTestRunnable(() -> {
try {
testRunnable.run();
}
catch (Throwable e) {
throwables[0] = e;
}
};
invokeTestRunnable(runnable);
});
if (throwables[0] != null) {
throw throwables[0];
@@ -321,9 +321,9 @@ public abstract class UsefulTestCase extends TestCase {
protected void runTest() throws Throwable {
final Throwable[] throwables = new Throwable[1];
Runnable runnable = () -> {
invokeTestRunnable(() -> {
try {
UsefulTestCase.super.runTest();
super.runTest();
}
catch (InvocationTargetException e) {
e.fillInStackTrace();
@@ -336,9 +336,7 @@ public abstract class UsefulTestCase extends TestCase {
catch (Throwable e) {
throwables[0] = e;
}
};
invokeTestRunnable(runnable);
});
if (throwables[0] != null) {
throw throwables[0];
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public class CreateClassFixTest extends UsefulTestCase{
@Before
public void setUp() throws Exception {
final Ref<Exception> ex = new Ref<Exception>();
final Ref<Exception> ex = new Ref<>();
Runnable runnable = new Runnable() {
public void run() {
try {
@@ -83,18 +83,17 @@ public class CreateClassFixTest extends UsefulTestCase{
@After
public void tearDown() throws Exception {
final Ref<Exception> ex = new Ref<Exception>();
Runnable runnable = () -> {
final Ref<Exception> ex = new Ref<>();
invokeTestRunnable(() -> {
try {
myFixture.tearDown();
myFixture = null;
CreateClassFixTest.super.tearDown();
super.tearDown();
}
catch (Exception e) {
ex.set(e);
}
};
invokeTestRunnable(runnable);
});
final Exception exception = ex.get();
if (exception != null) {
throw exception;
@@ -116,7 +115,7 @@ public class CreateClassFixTest extends UsefulTestCase{
@Test
public void runSingle() throws Throwable {
Runnable runnable = () -> {
invokeTestRunnable(() -> {
IntentionAction resultAction = null;
final String createAction = QuickFixBundle.message(myCreateClass ? "create.class.text" : "create.interface.text", myTestName);
final List<IntentionAction> actions = myFixture.getAvailableIntentions(getSourceRoot() + "/plugin" + myTestName + ".xml");
@@ -130,7 +129,6 @@ public class CreateClassFixTest extends UsefulTestCase{
myFixture.launchAction(resultAction);
final Project project = myFixture.getProject();
Assert.assertNotNull(JavaPsiFacade.getInstance(project).findClass(myTestName, GlobalSearchScope.allScope(project)));
};
invokeTestRunnable(runnable);
});
}
}