mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do less stuff in test tearDown
This commit is contained in:
@@ -420,9 +420,6 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da
|
||||
if (encodingManager instanceof EncodingManagerImpl) ((EncodingManagerImpl)encodingManager).clearDocumentQueue();
|
||||
|
||||
FileDocumentManager manager = FileDocumentManager.getInstance();
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(EmptyRunnable.getInstance()); // Flush postponed formatting if any.
|
||||
manager.saveAllDocuments();
|
||||
if (manager instanceof FileDocumentManagerImpl) {
|
||||
((FileDocumentManagerImpl)manager).dropAllUnsavedDocuments();
|
||||
}
|
||||
@@ -439,12 +436,8 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da
|
||||
((HintManagerImpl)HintManager.getInstance()).cleanup();
|
||||
DocumentCommitThread.getInstance().clearQueue();
|
||||
|
||||
EdtTestUtil.runInEdtAndWait(() -> {
|
||||
((UndoManagerImpl)UndoManager.getGlobalInstance()).dropHistoryInTests();
|
||||
((UndoManagerImpl)UndoManager.getInstance(project)).dropHistoryInTests();
|
||||
|
||||
UIUtil.dispatchAllInvocationEvents();
|
||||
});
|
||||
((UndoManagerImpl)UndoManager.getGlobalInstance()).dropHistoryInTests();
|
||||
((UndoManagerImpl)UndoManager.getInstance(project)).dropHistoryInTests();
|
||||
|
||||
TemplateDataLanguageMappings.getInstance(project).cleanupForNextTest();
|
||||
}
|
||||
@@ -456,11 +449,14 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da
|
||||
CompletionProgressIndicator.cleanupForNextTest();
|
||||
}
|
||||
|
||||
documentManager.clearUncommittedDocuments();
|
||||
|
||||
UIUtil.dispatchAllInvocationEvents();
|
||||
|
||||
if (checkForEditors) {
|
||||
checkEditorsReleased(exceptions);
|
||||
}
|
||||
documentManager.clearUncommittedDocuments();
|
||||
|
||||
|
||||
if (ourTestCount++ % 100 == 0) {
|
||||
// some tests are written in Groovy, and running all of them may result in some 40M of memory wasted on bean infos
|
||||
// so let's clear the cache every now and then to ensure it doesn't grow too large
|
||||
|
||||
Reference in New Issue
Block a user