mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CodeInsightTestCase: more safe tearDown
This commit is contained in:
@@ -86,13 +86,19 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
FileEditorManager editorManager = FileEditorManager.getInstance(myProject);
|
||||
VirtualFile[] openFiles = editorManager.getOpenFiles();
|
||||
for (VirtualFile openFile : openFiles) {
|
||||
editorManager.closeFile(openFile);
|
||||
try {
|
||||
if (myProject != null) {
|
||||
FileEditorManager editorManager = FileEditorManager.getInstance(myProject);
|
||||
VirtualFile[] openFiles = editorManager.getOpenFiles();
|
||||
for (VirtualFile openFile : openFiles) {
|
||||
editorManager.closeFile(openFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
myEditor = null;
|
||||
super.tearDown();
|
||||
}
|
||||
myEditor = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user