Cleanup (formatting)

This commit is contained in:
Roman Shevchenko
2017-02-06 19:04:06 +01:00
parent 66728e4f71
commit 9212fac283
2 changed files with 13 additions and 16 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 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.
@@ -25,6 +25,7 @@ import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.IdeActions;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.application.ex.PathManagerEx;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.command.WriteCommandAction;
@@ -208,7 +209,7 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
Editor editor = FileEditorManager.getInstance(getProject()).openTextEditor(new OpenFileDescriptor(getProject(), file, 0), false);
DaemonCodeAnalyzer.getInstance(getProject()).restart();
assertNotNull(editor);
((EditorImpl)editor).setCaretActive();
return editor;
}
@@ -279,16 +280,11 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
private static void deleteVFile() throws IOException {
if (myVFile != null) {
ApplicationManager.getApplication().runWriteAction(new ThrowableComputable<Void, IOException>() {
@Override
public Void compute() throws IOException {
// avoid messing with invalid files, in case someone calls configureXXX() several times
PsiDocumentManager.getInstance(ourProject).commitAllDocuments();
FileEditorManager.getInstance(ourProject).closeFile(myVFile);
myVFile.delete(this);
return null;
}
WriteAction.run(() -> {
// avoid messing with invalid files, in case someone calls configureXXX() several times
PsiDocumentManager.getInstance(ourProject).commitAllDocuments();
FileEditorManager.getInstance(ourProject).closeFile(myVFile);
myVFile.delete(ourProject);
});
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 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.
@@ -30,8 +30,9 @@ public class BareTestFixtureImpl extends BaseFixture implements BareTestFixture
@Override
public void tearDown() throws Exception {
new RunAll(() -> EdtTestUtil.runInEdtAndWait(() -> PlatformTestCase.cleanupApplicationCaches(null)),
() -> super.tearDown())
.run();
new RunAll(
() -> EdtTestUtil.runInEdtAndWait(() -> PlatformTestCase.cleanupApplicationCaches(null)),
() -> super.tearDown()
).run();
}
}