Fixes after LightPlatformCodeInsightTestCase stopped execution test under write action by default
See 1d1025401ffb7a06b3340069e06dad14a2e73ddd in intellij-community https://github.com/JetBrains/intellij-community/commit/1d1025401ffb7a06b3340069e06dad14a2e73ddd
This commit is contained in:
+5
@@ -125,6 +125,11 @@ public abstract class AbstractSurroundWithTest extends LightCodeInsightTestCase
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRunInWriteAction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
|
||||
+11
-2
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.idea.codeInsight.unwrap;
|
||||
|
||||
import com.intellij.codeInsight.unwrap.Unwrapper;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -89,10 +90,18 @@ public abstract class AbstractUnwrapRemoveTest extends LightCodeInsightTestCase
|
||||
new KotlinUnwrapDescriptor().collectUnwrappers(getProject(), getEditor(), getFile());
|
||||
|
||||
if (isApplicableExpected) {
|
||||
Pair<PsiElement, Unwrapper> selectedUnwrapperWithPsi = unwrappersWithPsi.get(optionIndex);
|
||||
final Pair<PsiElement, Unwrapper> selectedUnwrapperWithPsi = unwrappersWithPsi.get(optionIndex);
|
||||
assertEquals(unwrapperClass, selectedUnwrapperWithPsi.second.getClass());
|
||||
|
||||
selectedUnwrapperWithPsi.second.unwrap(getEditor(), selectedUnwrapperWithPsi.first);
|
||||
final PsiElement first = selectedUnwrapperWithPsi.first;
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
selectedUnwrapperWithPsi.second.unwrap(getEditor(), first);
|
||||
}
|
||||
});
|
||||
|
||||
checkResultByFile(path + ".after");
|
||||
} else {
|
||||
assertTrue(
|
||||
|
||||
Reference in New Issue
Block a user