From f91fa9a80486cbf13e98076d5a219a4a51dec68a Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Sun, 25 Nov 2018 16:21:45 +0300 Subject: [PATCH] do not swallow exceptions in tearDown() --- .../compiler/BaseCompilerTestCase.java | 3 ++ .../intellij/compiler/CompilerTestCase.java | 3 ++ .../compiler/ModuleCompilerUtilTest.java | 3 ++ .../com/intellij/facet/FacetTestCase.java | 3 ++ .../detection/FrameworkDetectionTestCase.java | 3 ++ .../SaveProjectAsTemplateTest.java | 3 ++ .../AbstractParameterInfoTestCase.java | 8 +--- .../NullableNotNullManagerTest.java | 3 ++ .../ReformatCodeActionInEditorTest.java | 3 ++ .../completion/CompletionHintsTest.java | 3 ++ .../completion/CompletionSortingTestCase.java | 3 ++ .../completion/CompletionStyleTest.java | 3 ++ .../completion/EditorTabOutTest.java | 3 ++ .../MethodChainsCompletionTest.java | 6 ++- .../LightAdvHighlightingPerformanceTest.java | 3 ++ .../codeInsight/daemon/LossyEncodingTest.java | 3 ++ .../impl/SdkSetupNotificationTestBase.java | 3 ++ .../daemon/lambda/TypeInference18Test.java | 3 ++ .../AnnotateMethodInGeneratedFilesTest.java | 3 ++ .../daemon/quickFix/OrderEntryTest.java | 3 ++ .../Simplify2DiamondInspectionsTest.java | 3 ++ .../folding/JavaFoldingTestCase.java | 3 ++ .../LiveTemplateEditorActionsTest.java | 3 ++ .../completion/TemplatesCompletionTest.java | 3 ++ .../templates/LambdaPostfixTemplateTest.java | 3 ++ ...ectsRequireNonNullPostfixTemplateTest.java | 3 ++ .../OptionalPostfixTemplateTest.java | 3 ++ .../templates/StreamPostfixTemplateTest.java | 3 ++ .../NullableStuffInspectionTest.java | 3 ++ .../compiler/CompilerReferencesTestBase.java | 3 ++ .../java/editor/JavaHighlighterTest.java | 3 ++ ...TestFrameworkCompilingIntegrationTest.java | 3 ++ .../execution/BaseConfigurationTestCase.java | 3 ++ .../ConfigurationRefactoringsTest.java | 3 ++ .../JavaFileStructureTestCase.java | 3 ++ .../AbstractApplyAndRevertTestCase.java | 9 +++-- .../Java12SwitchExpressionSanityTest.java | 3 ++ .../JavaCodeInsightSanityTest.java | 4 +- .../java/psi/Src15RepositoryUseTest.java | 3 ++ .../autodetect/DetectIndentAndTypeTest.java | 3 ++ .../java/psi/search/UpdateCacheTest.java | 3 ++ .../configuration/LanguageLevelComboTest.java | 3 ++ .../projectView/ProjectTreeSortingTest.java | 3 ++ .../projectView/ScopeViewPaneTest.java | 3 ++ .../completion/LightCompletionTestCase.java | 1 - .../LightCodeInsightFixtureTestCase.java | 3 ++ .../VcsRepositoryManagerTest.java | 3 ++ .../execution/impl/ExecutionManagerTest.java | 3 ++ .../intellij/find/impl/FindUIHelperTest.java | 3 ++ .../wm/impl/ToolWindowManagerTestCase.java | 3 ++ .../execution/impl/ConsoleViewImplTest.java | 3 ++ .../integration/IntegrationTestCase.java | 3 ++ .../integration/LocalHistoryStorageTest.java | 3 ++ .../ui/LocalHistoryActionsTest.java | 3 ++ .../ide/bookmarks/BookmarkManagerTest.java | 3 ++ .../CodeStyleSchemesModelTest.java | 3 ++ .../NewProjectSettingsTest.java | 5 ++- .../ProjectCodeStyleMigrationTest.java | 3 ++ .../impl/LightFileTemplatesTest.java | 3 ++ .../actionSystem/PresentationTest.java | 6 ++- .../diff/impl/splitter/FoldingTestCase.java | 3 ++ .../openapi/editor/EditorMultiCaretTest.java | 3 ++ .../editor/EditorMultiCaretUndoRedoTest.java | 3 ++ .../impl/MarkerTreeWithPartialSumsTest.java | 3 ++ .../impl/TrailingSpacesStripperTest.java | 3 ++ ...apApplianceOnDocumentModificationTest.java | 3 ++ .../fileEditor/FileEditorManagerTest.java | 3 ++ .../impl/IdeDocumentHistoryTest.java | 3 ++ .../keymap/IdeKeyEventDispatcherTest.java | 3 ++ .../impl/IdeMouseEventDispatcherTest.java | 3 ++ .../ModifierKeyDoubleClickHandlerTest.java | 3 ++ .../keymap/impl/ui/ActionsTreeTest.java | 3 ++ .../module/ModulesConfigurationTest.java | 3 ++ .../vfs/encoding/FileEncodingTest.java | 3 ++ .../vfs/impl/VirtualFilePointerTest.java | 3 ++ .../PsiAvailabilityServiceTest.java | 3 ++ .../psi/impl/PsiDocumentManagerImplTest.java | 3 ++ .../util/io/PersistencePerformanceTest.java | 3 ++ .../util/net/ssl/CertificateTest.java | 3 ++ ...IdBasedToSMTRunnerEventsConvertorTest.java | 3 ++ .../sm/runner/SMTRunnerConsoleTest.java | 3 ++ .../sm/runner/SMTRunnerIntegrationTest.java | 3 ++ .../com/intellij/testFramework/RunAll.java | 9 ++++- .../testFramework/UsefulTestCase.java | 31 +++++++++++++- .../fixtures/impl/BaseFixture.java | 40 ++++++++++++++++++- .../impl/LightTempDirTestFixtureImpl.java | 3 ++ .../fixtures/impl/TempDirTestFixtureImpl.java | 3 ++ .../vcs/log/data/VcsLogRefresherTest.java | 3 ++ .../openapi/vcs/DirectoryMappingListTest.java | 3 ++ .../openapi/vcs/IgnoreIdeaLevelTest.java | 3 ++ ...ousPackagePrivateAccessInspectionTest.java | 3 ++ .../CoverageAnnotatorIntegrationTest.java | 3 ++ .../properties/PropertiesCharsetTest.java | 3 ++ .../completion/XmlCompletionTest.java | 3 ++ .../daemon/XmlHighlightingTest.java | 3 ++ .../intellij/editor/XmlHighlighterTest.java | 3 ++ .../structureView/HtmlFileStructureTest.java | 3 ++ 97 files changed, 360 insertions(+), 20 deletions(-) diff --git a/java/compiler/tests/com/intellij/compiler/BaseCompilerTestCase.java b/java/compiler/tests/com/intellij/compiler/BaseCompilerTestCase.java index fb9f594aea46..b5bf169f6d58 100644 --- a/java/compiler/tests/com/intellij/compiler/BaseCompilerTestCase.java +++ b/java/compiler/tests/com/intellij/compiler/BaseCompilerTestCase.java @@ -85,6 +85,9 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { } CompilerTestUtil.disableExternalCompiler(getProject()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/compiler/tests/com/intellij/compiler/CompilerTestCase.java b/java/compiler/tests/com/intellij/compiler/CompilerTestCase.java index 87bace43b97b..4afb23425c69 100644 --- a/java/compiler/tests/com/intellij/compiler/CompilerTestCase.java +++ b/java/compiler/tests/com/intellij/compiler/CompilerTestCase.java @@ -435,6 +435,9 @@ public abstract class CompilerTestCase extends ModuleTestCase { myOriginalSourceDir = null; CompilerTestUtil.disableExternalCompiler(myProject); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/compiler/tests/com/intellij/compiler/ModuleCompilerUtilTest.java b/java/compiler/tests/com/intellij/compiler/ModuleCompilerUtilTest.java index 864d8a7dd0f1..f69cb2d6c8f3 100644 --- a/java/compiler/tests/com/intellij/compiler/ModuleCompilerUtilTest.java +++ b/java/compiler/tests/com/intellij/compiler/ModuleCompilerUtilTest.java @@ -46,6 +46,9 @@ public class ModuleCompilerUtilTest extends ModuleTestCase { try { myTempDirTestFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/idea-ui/testSrc/com/intellij/facet/FacetTestCase.java b/java/idea-ui/testSrc/com/intellij/facet/FacetTestCase.java index 532499f61218..c782f2c68f1a 100644 --- a/java/idea-ui/testSrc/com/intellij/facet/FacetTestCase.java +++ b/java/idea-ui/testSrc/com/intellij/facet/FacetTestCase.java @@ -21,6 +21,9 @@ public abstract class FacetTestCase extends PsiTestCase { try { removeAllFacets(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/idea-ui/testSrc/com/intellij/framework/detection/FrameworkDetectionTestCase.java b/java/idea-ui/testSrc/com/intellij/framework/detection/FrameworkDetectionTestCase.java index de27bf8cb905..8595867ccb4a 100644 --- a/java/idea-ui/testSrc/com/intellij/framework/detection/FrameworkDetectionTestCase.java +++ b/java/idea-ui/testSrc/com/intellij/framework/detection/FrameworkDetectionTestCase.java @@ -24,6 +24,9 @@ public abstract class FrameworkDetectionTestCase extends PlatformTestCase { try { FrameworkDetectionManager.getInstance(myProject).doDispose(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/idea-ui/testSrc/com/intellij/ide/projectWizard/SaveProjectAsTemplateTest.java b/java/idea-ui/testSrc/com/intellij/ide/projectWizard/SaveProjectAsTemplateTest.java index 1839a78b3e7a..baf88a3fe6e6 100644 --- a/java/idea-ui/testSrc/com/intellij/ide/projectWizard/SaveProjectAsTemplateTest.java +++ b/java/idea-ui/testSrc/com/intellij/ide/projectWizard/SaveProjectAsTemplateTest.java @@ -138,6 +138,9 @@ public class SaveProjectAsTemplateTest extends NewProjectWizardTestCase { ((FileTemplateManagerImpl)FileTemplateManager.getDefaultInstance()).setTestDate(null); PropertiesComponent.getInstance().unsetValue(ProjectTemplateParameterFactory.IJ_BASE_PACKAGE); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java index 81968b1ca61e..6955a27e7bc8 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java @@ -35,12 +35,8 @@ public abstract class AbstractParameterInfoTestCase extends LightFixtureCompleti @Override protected void tearDown() throws Exception { - try { - CodeInsightSettings.getInstance().PARAMETER_INFO_DELAY = myStoredAutoPopupDelay; - } - finally { - super.tearDown(); - } + CodeInsightSettings.getInstance().PARAMETER_INFO_DELAY = myStoredAutoPopupDelay; + super.tearDown(); } protected void configureJava(String text) { diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java index 565cd3419589..c54324d22603 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java @@ -26,6 +26,9 @@ public class NullableNotNullManagerTest extends LightPlatformTestCase { try { myManager.loadState(new Element("x")); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/ReformatCodeActionInEditorTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/ReformatCodeActionInEditorTest.java index 495e6f02b831..d48edfe9e420 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/ReformatCodeActionInEditorTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/actions/ReformatCodeActionInEditorTest.java @@ -41,6 +41,9 @@ public class ReformatCodeActionInEditorTest extends LightPlatformCodeInsightFixt try { myFixture.getFile().putUserData(FormatChangedTextUtil.TEST_REVISION_CONTENT, null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java index 19fef4818658..2cc8a3b6dcad 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java @@ -36,6 +36,9 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { try { CodeInsightSettings.getInstance().SHOW_PARAMETER_NAME_HINTS_ON_COMPLETION = myStoredSettingValue; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionSortingTestCase.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionSortingTestCase.java index 3ab0c2a3ff83..8a9821bfe6b7 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionSortingTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionSortingTestCase.java @@ -37,6 +37,9 @@ public abstract class CompletionSortingTestCase extends LightFixtureCompletionTe LookupManager.hideActiveLookup(getProject()); UISettings.getInstance().setSortLookupElementsLexicographically(false); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionStyleTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionStyleTest.java index 4a1734b1b493..3b9f5a693748 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionStyleTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionStyleTest.java @@ -329,6 +329,9 @@ public class CompletionStyleTest extends LightCodeInsightTestCase{ try { LookupManager.hideActiveLookup(getProject()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/EditorTabOutTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/EditorTabOutTest.java index d34c26b1cbcb..99656ecd19c1 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/EditorTabOutTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/EditorTabOutTest.java @@ -20,6 +20,9 @@ public class EditorTabOutTest extends AbstractParameterInfoTestCase { try { CodeInsightSettings.getInstance().TAB_EXITS_BRACKETS_AND_QUOTES = mySavedTabOutSetting; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/MethodChainsCompletionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/MethodChainsCompletionTest.java index c22263fba001..f24acf707c6b 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/MethodChainsCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/MethodChainsCompletionTest.java @@ -40,7 +40,11 @@ public class MethodChainsCompletionTest extends AbstractCompilerAwareTest { public void tearDown() throws Exception { try { CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = myDefaultAutoCompleteOnCodeCompletion; - } finally { + } + catch (Throwable e) { + addSuppressedException(e); + } + finally { super.tearDown(); } } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java index 9e177b92d0ed..8cdbb14e3e3e 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java @@ -64,6 +64,9 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest try { Disposer.dispose(my); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LossyEncodingTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LossyEncodingTest.java index 7ff11f5c42b8..fb1fb38ed3fb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LossyEncodingTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LossyEncodingTest.java @@ -51,6 +51,9 @@ public class LossyEncodingTest extends DaemonAnalyzerTestCase { try { UIUtil.dispatchAllInvocationEvents(); // invokeLater() in EncodingProjectManagerImpl.reloadAllFilesUnder() } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/impl/SdkSetupNotificationTestBase.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/impl/SdkSetupNotificationTestBase.java index 79f99dfd4b88..c9d415353c29 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/impl/SdkSetupNotificationTestBase.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/impl/SdkSetupNotificationTestBase.java @@ -37,6 +37,9 @@ public abstract class SdkSetupNotificationTestBase extends JavaCodeInsightFixtur try { FileEditorManagerEx.getInstanceEx(getProject()).closeAllFiles(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java index 8c989c001e16..baec321c3c4f 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java @@ -72,6 +72,9 @@ public class TypeInference18Test extends ResolveTestCase { try { LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(myOldLanguageLevel); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/AnnotateMethodInGeneratedFilesTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/AnnotateMethodInGeneratedFilesTest.java index 2c86b92afd08..0f39ac2224b2 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/AnnotateMethodInGeneratedFilesTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/AnnotateMethodInGeneratedFilesTest.java @@ -39,6 +39,9 @@ public class AnnotateMethodInGeneratedFilesTest extends LightCodeInsightFixtureT try { Extensions.getRootArea().getExtensionPoint(GeneratedSourcesFilter.EP_NAME).unregisterExtension(myGeneratedSourcesFilter); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/OrderEntryTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/OrderEntryTest.java index 16214bb55d30..b946df62aa3d 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/OrderEntryTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/OrderEntryTest.java @@ -69,6 +69,9 @@ public class OrderEntryTest extends DaemonAnalyzerTestCase { try { removeLibs(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/Simplify2DiamondInspectionsTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/Simplify2DiamondInspectionsTest.java index b3a768db02b7..92b34c4159cc 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/Simplify2DiamondInspectionsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/quickFix/Simplify2DiamondInspectionsTest.java @@ -51,6 +51,9 @@ public class Simplify2DiamondInspectionsTest extends LightQuickFixParameterizedT try { getSettings().ALIGN_MULTILINE_PARAMETERS_IN_CALLS = myAlignment; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/folding/JavaFoldingTestCase.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/folding/JavaFoldingTestCase.java index 658b59d3e646..4ad2bda8b51e 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/folding/JavaFoldingTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/folding/JavaFoldingTestCase.java @@ -39,6 +39,9 @@ public abstract class JavaFoldingTestCase extends LightCodeInsightFixtureTestCas try { ((JavaCodeFoldingSettingsImpl)myFoldingSettings).loadState(((JavaCodeFoldingSettingsImpl)myFoldingSettingsBackup)); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/LiveTemplateEditorActionsTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/LiveTemplateEditorActionsTest.java index 8dbff2e01bc6..0d196230c85b 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/LiveTemplateEditorActionsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/LiveTemplateEditorActionsTest.java @@ -35,6 +35,9 @@ public class LiveTemplateEditorActionsTest extends LightCodeInsightFixtureTestCa templateState.gotoEnd(false); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/completion/TemplatesCompletionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/completion/TemplatesCompletionTest.java index a6af88161c42..11be5c05a4f7 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/completion/TemplatesCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/completion/TemplatesCompletionTest.java @@ -32,6 +32,9 @@ public class TemplatesCompletionTest extends CompletionAutoPopupTestCase { settings.setPostfixTemplatesEnabled(true); settings.setTemplatesCompletionEnabled(true); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/LambdaPostfixTemplateTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/LambdaPostfixTemplateTest.java index 8044d4412f5e..3b0ae0f09256 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/LambdaPostfixTemplateTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/LambdaPostfixTemplateTest.java @@ -37,6 +37,9 @@ public class LambdaPostfixTemplateTest extends PostfixTemplateTestCase { LanguageLevelProjectExtension.getInstance(myFixture.getProject()).setLanguageLevel(myDefaultLanguageLevel); myDefaultLanguageLevel = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/ObjectsRequireNonNullPostfixTemplateTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/ObjectsRequireNonNullPostfixTemplateTest.java index af8b014ab477..a7caa6cf6ceb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/ObjectsRequireNonNullPostfixTemplateTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/ObjectsRequireNonNullPostfixTemplateTest.java @@ -22,6 +22,9 @@ public class ObjectsRequireNonNullPostfixTemplateTest extends PostfixTemplateTes LanguageLevelProjectExtension.getInstance(myFixture.getProject()).setLanguageLevel(myDefaultLanguageLevel); myDefaultLanguageLevel = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/OptionalPostfixTemplateTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/OptionalPostfixTemplateTest.java index e184c9385343..7401e167683e 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/OptionalPostfixTemplateTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/OptionalPostfixTemplateTest.java @@ -37,6 +37,9 @@ public class OptionalPostfixTemplateTest extends PostfixTemplateTestCase { LanguageLevelProjectExtension.getInstance(myFixture.getProject()).setLanguageLevel(myDefaultLanguageLevel); myDefaultLanguageLevel = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/StreamPostfixTemplateTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/StreamPostfixTemplateTest.java index b9e8bdaa55a7..671d1d33b22e 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/StreamPostfixTemplateTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/template/postfix/templates/StreamPostfixTemplateTest.java @@ -37,6 +37,9 @@ public class StreamPostfixTemplateTest extends PostfixTemplateTestCase { LanguageLevelProjectExtension.getInstance(myFixture.getProject()).setLanguageLevel(myDefaultLanguageLevel); myDefaultLanguageLevel = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/NullableStuffInspectionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInspection/NullableStuffInspectionTest.java index a5235b191d92..59e7f852e32e 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInspection/NullableStuffInspectionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInspection/NullableStuffInspectionTest.java @@ -54,6 +54,9 @@ public class NullableStuffInspectionTest extends LightCodeInsightFixtureTestCase myInspection = null; Extensions.getRootArea().getExtensionPoint(GeneratedSourcesFilter.EP_NAME).unregisterExtension(myGeneratedSourcesFilter); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/compiler/CompilerReferencesTestBase.java b/java/java-tests/testSrc/com/intellij/java/compiler/CompilerReferencesTestBase.java index bdc6e24a20f9..a838c189ba1c 100644 --- a/java/java-tests/testSrc/com/intellij/java/compiler/CompilerReferencesTestBase.java +++ b/java/java-tests/testSrc/com/intellij/java/compiler/CompilerReferencesTestBase.java @@ -33,6 +33,9 @@ public abstract class CompilerReferencesTestBase extends AbstractCompilerAwareTe try { CompilerReferenceService.IS_ENABLED_KEY.setValue(myDefaultEnableState); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/editor/JavaHighlighterTest.java b/java/java-tests/testSrc/com/intellij/java/editor/JavaHighlighterTest.java index fa8c1715fe6d..6fd734b53a9c 100644 --- a/java/java-tests/testSrc/com/intellij/java/editor/JavaHighlighterTest.java +++ b/java/java-tests/testSrc/com/intellij/java/editor/JavaHighlighterTest.java @@ -34,6 +34,9 @@ public class JavaHighlighterTest extends LightCodeInsightTestCase { EditorFactory.getInstance().releaseEditor(editor); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/execution/AbstractTestFrameworkCompilingIntegrationTest.java b/java/java-tests/testSrc/com/intellij/java/execution/AbstractTestFrameworkCompilingIntegrationTest.java index b3fa98a6fcf3..88c99caf499e 100644 --- a/java/java-tests/testSrc/com/intellij/java/execution/AbstractTestFrameworkCompilingIntegrationTest.java +++ b/java/java-tests/testSrc/com/intellij/java/execution/AbstractTestFrameworkCompilingIntegrationTest.java @@ -54,6 +54,9 @@ public abstract class AbstractTestFrameworkCompilingIntegrationTest extends Abst try { myCompilerTester.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/execution/BaseConfigurationTestCase.java b/java/java-tests/testSrc/com/intellij/java/execution/BaseConfigurationTestCase.java index 19c216a7305f..7b8ceb0b0212 100644 --- a/java/java-tests/testSrc/com/intellij/java/execution/BaseConfigurationTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/execution/BaseConfigurationTestCase.java @@ -44,6 +44,9 @@ public abstract class BaseConfigurationTestCase extends IdeaTestCase { try { myModulesToDispose.clear(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/execution/ConfigurationRefactoringsTest.java b/java/java-tests/testSrc/com/intellij/java/execution/ConfigurationRefactoringsTest.java index d82900b0abd6..fbcd908c7398 100644 --- a/java/java-tests/testSrc/com/intellij/java/execution/ConfigurationRefactoringsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/execution/ConfigurationRefactoringsTest.java @@ -229,6 +229,9 @@ public class ConfigurationRefactoringsTest extends BaseConfigurationTestCase { mySource.tearDown(); mySource = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/ide/fileStructure/JavaFileStructureTestCase.java b/java/java-tests/testSrc/com/intellij/java/ide/fileStructure/JavaFileStructureTestCase.java index b9e7325e74ee..3f33d43b6c4d 100644 --- a/java/java-tests/testSrc/com/intellij/java/ide/fileStructure/JavaFileStructureTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/ide/fileStructure/JavaFileStructureTestCase.java @@ -64,6 +64,9 @@ public abstract class JavaFileStructureTestCase extends FileStructureTestBase { try { PropertiesComponent.getInstance().setValue(getAnonymousPropertyName(), myShowAnonymousByDefault); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/propertyBased/AbstractApplyAndRevertTestCase.java b/java/java-tests/testSrc/com/intellij/java/propertyBased/AbstractApplyAndRevertTestCase.java index 0b6809741892..73f5dd5115f1 100644 --- a/java/java-tests/testSrc/com/intellij/java/propertyBased/AbstractApplyAndRevertTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/propertyBased/AbstractApplyAndRevertTestCase.java @@ -101,16 +101,19 @@ public abstract class AbstractApplyAndRevertTestCase extends PlatformTestCase { @Override public void tearDown() throws Exception { - if (myCompilerTester != null) { - myCompilerTester.tearDown(); - } try { + if (myCompilerTester != null) { + myCompilerTester.tearDown(); + } PathMacros.getInstance().setMacro(PathMacrosImpl.MAVEN_REPOSITORY, oldMacroValue); ProjectManager.getInstance().closeProject(myProject); WriteAction.run(() -> Disposer.dispose(myProject)); myProject = null; InspectionProfileImpl.INIT_INSPECTIONS = false; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/propertyBased/Java12SwitchExpressionSanityTest.java b/java/java-tests/testSrc/com/intellij/java/propertyBased/Java12SwitchExpressionSanityTest.java index 7473821cd2e1..c90b30814853 100644 --- a/java/java-tests/testSrc/com/intellij/java/propertyBased/Java12SwitchExpressionSanityTest.java +++ b/java/java-tests/testSrc/com/intellij/java/propertyBased/Java12SwitchExpressionSanityTest.java @@ -35,6 +35,9 @@ public class Java12SwitchExpressionSanityTest extends LightCodeInsightFixtureTes try { JavaAwareProjectJdkTableImpl.removeInternalJdkInTests(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaCodeInsightSanityTest.java b/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaCodeInsightSanityTest.java index 4dc5c315d81e..9b67a327723d 100644 --- a/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaCodeInsightSanityTest.java +++ b/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaCodeInsightSanityTest.java @@ -5,7 +5,6 @@ import com.intellij.java.psi.formatter.java.AbstractJavaFormatterTest; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl; import com.intellij.psi.PsiFile; -import com.intellij.psi.codeStyle.JavaCodeStyleSettings; import com.intellij.psi.impl.source.PsiEnumConstantImpl; import com.intellij.testFramework.LightProjectDescriptor; import com.intellij.testFramework.SkipSlowTestLocally; @@ -31,6 +30,9 @@ public class JavaCodeInsightSanityTest extends LightCodeInsightFixtureTestCase { try { JavaAwareProjectJdkTableImpl.removeInternalJdkInTests(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/Src15RepositoryUseTest.java b/java/java-tests/testSrc/com/intellij/java/psi/Src15RepositoryUseTest.java index 4f7d3c7f9e45..3e4a60a0e181 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/Src15RepositoryUseTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/Src15RepositoryUseTest.java @@ -44,6 +44,9 @@ public class Src15RepositoryUseTest extends PsiTestCase { try { LanguageLevelProjectExtension.getInstance(myProject).setLanguageLevel(LanguageLevel.JDK_1_5); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/DetectIndentAndTypeTest.java b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/DetectIndentAndTypeTest.java index 2a5375947446..f3f95f3e859a 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/DetectIndentAndTypeTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/DetectIndentAndTypeTest.java @@ -56,6 +56,9 @@ public class DetectIndentAndTypeTest extends LightPlatformCodeInsightFixtureTest optionsProvider.setEnabledInTest(false); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/search/UpdateCacheTest.java b/java/java-tests/testSrc/com/intellij/java/psi/search/UpdateCacheTest.java index e12fa1193d9c..3db719751364 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/search/UpdateCacheTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/search/UpdateCacheTest.java @@ -71,6 +71,9 @@ public class UpdateCacheTest extends PsiTestCase { try { ProjectManager.getInstance().closeProject(myProject); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/openapi/roots/ui/configuration/LanguageLevelComboTest.java b/java/java-tests/testSrc/com/intellij/openapi/roots/ui/configuration/LanguageLevelComboTest.java index e6a2bde4688c..6efee55acf03 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/roots/ui/configuration/LanguageLevelComboTest.java +++ b/java/java-tests/testSrc/com/intellij/openapi/roots/ui/configuration/LanguageLevelComboTest.java @@ -33,6 +33,9 @@ public class LanguageLevelComboTest extends LightPlatformTestCase { try { ProjectManagerEx.getInstanceEx().closeAndDispose(myProject); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/projectView/ProjectTreeSortingTest.java b/java/java-tests/testSrc/com/intellij/projectView/ProjectTreeSortingTest.java index d0d5120a5ae3..f0cacd430612 100644 --- a/java/java-tests/testSrc/com/intellij/projectView/ProjectTreeSortingTest.java +++ b/java/java-tests/testSrc/com/intellij/projectView/ProjectTreeSortingTest.java @@ -55,6 +55,9 @@ public class ProjectTreeSortingTest extends BaseProjectViewTestCase { myProjectView = null; myPane = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/java-tests/testSrc/com/intellij/projectView/ScopeViewPaneTest.java b/java/java-tests/testSrc/com/intellij/projectView/ScopeViewPaneTest.java index 20355253916c..64bb481a019b 100644 --- a/java/java-tests/testSrc/com/intellij/projectView/ScopeViewPaneTest.java +++ b/java/java-tests/testSrc/com/intellij/projectView/ScopeViewPaneTest.java @@ -46,6 +46,9 @@ public class ScopeViewPaneTest extends TestSourceBasedTestCase { try { restoreProjectViewDefaultSettings(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java b/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java index 7464d16ad752..7b5fb942a7b8 100644 --- a/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java @@ -38,7 +38,6 @@ public abstract class LightCompletionTestCase extends LightCodeInsightTestCase { protected void tearDown() throws Exception { try { myItems = null; - LookupManager.getInstance(getProject()).hideActiveLookup(); } finally { super.tearDown(); diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java b/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java index 24a09e485a37..7c5594fa312b 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java @@ -95,6 +95,9 @@ public abstract class LightCodeInsightFixtureTestCase extends UsefulTestCase { try { myFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myFixture = null; myModule = null; diff --git a/platform/dvcs-impl/testSrc/com.intellij.dvcs/VcsRepositoryManagerTest.java b/platform/dvcs-impl/testSrc/com.intellij.dvcs/VcsRepositoryManagerTest.java index cb1ab18590ea..0251bcf1a7bd 100644 --- a/platform/dvcs-impl/testSrc/com.intellij.dvcs/VcsRepositoryManagerTest.java +++ b/platform/dvcs-impl/testSrc/com.intellij.dvcs/VcsRepositoryManagerTest.java @@ -66,6 +66,9 @@ public class VcsRepositoryManagerTest extends VcsPlatformTest { getExtensionPoint().unregisterExtension(myMockCreator); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java b/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java index 26fb301fd30c..2e548239a4bf 100644 --- a/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java +++ b/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java @@ -33,6 +33,9 @@ public class ExecutionManagerTest extends LightPlatformTestCase { RunManagerConfig config = RunManagerImpl.getInstanceImpl(getProject()).getConfig(); config.setRestartRequiresConfirmation(myRestartRequiresConfirmation); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/lang-impl/testSources/com/intellij/find/impl/FindUIHelperTest.java b/platform/lang-impl/testSources/com/intellij/find/impl/FindUIHelperTest.java index 7c75a5e7a0db..bc82b2e437b5 100644 --- a/platform/lang-impl/testSources/com/intellij/find/impl/FindUIHelperTest.java +++ b/platform/lang-impl/testSources/com/intellij/find/impl/FindUIHelperTest.java @@ -44,6 +44,9 @@ public class FindUIHelperTest extends LightPlatformTestCase { assertTrue(Disposer.isDisposed(myUICopy.getDisposable())); assertNull(myHelper.myUI); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ToolWindowManagerTestCase.java b/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ToolWindowManagerTestCase.java index 9a373fcb45c7..29eee0b42f5e 100644 --- a/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ToolWindowManagerTestCase.java +++ b/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ToolWindowManagerTestCase.java @@ -39,6 +39,9 @@ public abstract class ToolWindowManagerTestCase extends LightPlatformCodeInsight ((ComponentManagerImpl)getProject()).registerComponentInstance(ToolWindowManager.class, myOldManager); myOldManager = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java index 8cd504a3d864..4c82649a80b4 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java @@ -61,6 +61,9 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { try { Disposer.dispose(myConsole); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java index 01af4865bd3b..5c395ed42e08 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java @@ -86,6 +86,9 @@ public abstract class IntegrationTestCase extends PlatformTestCase { Clock.reset(); Paths.useSystemCaseSensitivity(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java index 98bdab32a5eb..eebae447aac6 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java @@ -38,6 +38,9 @@ public class LocalHistoryStorageTest extends IntegrationTestCase { try { Disposer.dispose(myStorage); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java index 579a7c20967a..1e70df94474d 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java @@ -57,6 +57,9 @@ public class LocalHistoryActionsTest extends LocalHistoryUITestCase { try { getEditorFactory().releaseEditor(editor); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java b/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java index 6824a5e8aaac..1a4a10b0496c 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java @@ -51,6 +51,9 @@ public class BookmarkManagerTest extends AbstractEditorTest { } myBookmarks.clear(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java index b70248ed2519..16db44758a30 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java @@ -52,6 +52,9 @@ public class CodeStyleSchemesModelTest extends CodeStyleTestCase { myModel.selectScheme(myDefaultScheme, null); myModel.apply(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java index 3e5fa886e8dc..cd69d183b788 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java @@ -15,13 +15,11 @@ */ package com.intellij.ide.codeStyleSettings; -import com.intellij.idea.Bombed; import com.intellij.psi.codeStyle.CodeStyleSettings; import com.intellij.psi.codeStyle.CodeStyleSettingsManager; import com.intellij.util.containers.ContainerUtilRt; import org.jetbrains.annotations.NotNull; -import java.util.Calendar; import java.util.Map; public class NewProjectSettingsTest extends CodeStyleTestCase { @@ -47,6 +45,9 @@ public class NewProjectSettingsTest extends CodeStyleTestCase { try { restoreDefaults(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java index b44e3ffda5fe..9db1ed10dd89 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java @@ -43,6 +43,9 @@ public class ProjectCodeStyleMigrationTest extends CodeStyleTestCase { try { CodeStyle.getSettings(getProject()).copyFrom(CodeStyleSettings.getDefaults()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java b/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java index 0b2ac54043bd..9214f5e1a76b 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java @@ -244,6 +244,9 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { myTemplateManager.setCurrentScheme(FileTemplatesScheme.DEFAULT); PropertiesComponent.getInstance().unsetValue("FileTemplates.SelectedTemplate"); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java index 0b8562534521..db13e0234164 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/actionSystem/PresentationTest.java @@ -68,7 +68,11 @@ public class PresentationTest extends PlatformTestCase { UISettingsState uiSettings = UISettings.getInstance().getState(); uiSettings.setDisableMnemonics(defaults.getDisableMnemonics()); uiSettings.setDisableMnemonicsInControls(defaults.getDisableMnemonicsInControls()); - } finally { + } + catch (Throwable e) { + addSuppressedException(e); + } + finally { super.tearDown(); } } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/FoldingTestCase.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/FoldingTestCase.java index 2e2f85a7e610..af36af02fbce 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/FoldingTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/splitter/FoldingTestCase.java @@ -52,6 +52,9 @@ public abstract class FoldingTestCase extends PlatformTestCase { } myEditorsToDispose.clear(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java index a0f435e76a8c..e374cfcc9238 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java @@ -46,6 +46,9 @@ public class EditorMultiCaretTest extends AbstractEditorTest { try { EditorSettingsExternalizable.getInstance().setVirtualSpace(myStoredVirtualSpaceSetting); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java index c97096592b71..3ebcff66a497 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java @@ -41,6 +41,9 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { try { getUndoManager().setEditorProvider(mySavedCurrentEditorProvider); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/MarkerTreeWithPartialSumsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/MarkerTreeWithPartialSumsTest.java index 3d8d4b63d5f6..339242ff6db0 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/MarkerTreeWithPartialSumsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/MarkerTreeWithPartialSumsTest.java @@ -39,6 +39,9 @@ public class MarkerTreeWithPartialSumsTest extends AbstractEditorTest { try { if (myTree != null) myTree.dispose(myDocument); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java index 103961ccd987..b63e29f9e884 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java @@ -53,6 +53,9 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase try { EditorSettingsExternalizable.getInstance().loadState(oldSettings); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java index dc8b09bfe630..f66cde73f06a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java @@ -51,6 +51,9 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT settings.setSmartHome(mySmartHome); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java index 44243fbd99da..a2a63891c871 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java @@ -47,6 +47,9 @@ public class FileEditorManagerTest extends FileEditorManagerTestCase { uiSettings.setReuseNotModifiedTabs(template.getReuseNotModifiedTabs()); uiSettings.setEditorTabPlacement(template.getEditorTabPlacement()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java index 53193902b2be..e075ec5d782a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java @@ -81,6 +81,9 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { myState2 = null; myState3 = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/IdeKeyEventDispatcherTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/IdeKeyEventDispatcherTest.java index 59671e9975a1..46780b722a08 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/IdeKeyEventDispatcherTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/IdeKeyEventDispatcherTest.java @@ -44,6 +44,9 @@ public class IdeKeyEventDispatcherTest extends LightPlatformTestCase { KeymapManagerEx.getInstanceEx().setActiveKeymap(mySavedKeymap); ActionManager.getInstance().unregisterAction(ACTION_EMPTY); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java index 0fc8eb48c76b..808799e0c1a6 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java @@ -60,6 +60,9 @@ public class IdeMouseEventDispatcherTest extends LightPlatformTestCase { KeymapManagerEx.getInstanceEx().setActiveKeymap(mySavedKeymap); ActionManager.getInstance().unregisterAction(OUR_TEST_ACTION); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java index b653d5ad9558..1b475edb42ef 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ModifierKeyDoubleClickHandlerTest.java @@ -95,6 +95,9 @@ public class ModifierKeyDoubleClickHandlerTest extends LightPlatformTestCase { ActionManager.getInstance().unregisterAction(MY_SHIFT_SHIFT_ACTION); Clock.reset(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java index 7c17779b633a..c14984acb41f 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java @@ -172,6 +172,9 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { ((KeymapManagerImpl)KeymapManager.getInstance()).unbindShortcuts(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED_IN_PARENT); ((KeymapManagerImpl)KeymapManager.getInstance()).unbindShortcuts(ACTION_WITH_USE_SHORTCUT_OF_NON_EXISTENT_ACTION); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java index 7f6aa6605b4c..b4ab8678cb61 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/module/ModulesConfigurationTest.java @@ -99,6 +99,9 @@ public class ModulesConfigurationTest extends PlatformTestCase { try { ApplicationManagerEx.getApplicationEx().setSaveAllowed(isSaveAllowed); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java index 5771472b3985..a9c37d2c636c 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java @@ -98,6 +98,9 @@ public class FileEncodingTest extends PlatformTestCase implements TestDialog { try { Messages.setTestDialog(myOldTestDialogValue); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java index f38d6a732e78..c6ceb219fdbd 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java @@ -68,6 +68,9 @@ public class VirtualFilePointerTest extends LightPlatformTestCase { assertEquals(numberOfListenersBefore, nListeners); assertEquals(pointersBefore, pointersAfter); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/psi/availability/PsiAvailabilityServiceTest.java b/platform/platform-tests/testSrc/com/intellij/psi/availability/PsiAvailabilityServiceTest.java index daf7fbea19b0..acfc739d117d 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/availability/PsiAvailabilityServiceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/availability/PsiAvailabilityServiceTest.java @@ -37,6 +37,9 @@ public class PsiAvailabilityServiceTest extends PlatformTestCase { try { LaterInvocator.leaveAllModals(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java b/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java index 838c27eb2503..c75080ab1512 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java @@ -91,6 +91,9 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { try { LaterInvocator.leaveAllModals(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/PersistencePerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/PersistencePerformanceTest.java index f40bc1440ae3..d8df8cf7e0a4 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/PersistencePerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/PersistencePerformanceTest.java @@ -87,6 +87,9 @@ public class PersistencePerformanceTest extends LightPlatformCodeInsightFixtureT myEnumerator = null; myMaps.clear(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java b/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java index ac4ed5da1ec4..54f767babeed 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java @@ -182,6 +182,9 @@ public class CertificateTest extends LightPlatformTestCase { try { myClient.close(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java index 8fd4be798194..f55890644156 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java @@ -50,6 +50,9 @@ public class GeneralIdBasedToSMTRunnerEventsConvertorTest extends BaseSMTRunnerT Disposer.dispose(myEventsProcessor); Disposer.dispose(myConsole); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java index 8853be3f79f4..5361e45fdcbc 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java @@ -68,6 +68,9 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { Disposer.dispose(myEventsProcessor); Disposer.dispose(myConsole); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerIntegrationTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerIntegrationTest.java index f9e4d1bce89f..0e97d0e6810e 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerIntegrationTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerIntegrationTest.java @@ -63,6 +63,9 @@ public class SMTRunnerIntegrationTest extends LightPlatformTestCase { myProcessHandler.destroyProcess(); Disposer.dispose(myConsole); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/testFramework/src/com/intellij/testFramework/RunAll.java b/platform/testFramework/src/com/intellij/testFramework/RunAll.java index d90ee47b4d5b..b46aa92e0888 100644 --- a/platform/testFramework/src/com/intellij/testFramework/RunAll.java +++ b/platform/testFramework/src/com/intellij/testFramework/RunAll.java @@ -25,7 +25,7 @@ public class RunAll implements Runnable { this(ContainerUtil.newArrayList(actions)); } - public RunAll(@NotNull List> actions) { + private RunAll(@NotNull List> actions) { myActions = actions; } @@ -37,7 +37,12 @@ public class RunAll implements Runnable { @Override public void run() { - CompoundRuntimeException.throwIfNotEmpty(collectExceptions()); + run(Collections.emptyList()); + } + public void run(@NotNull List suppressedExceptions) { + List throwables = collectExceptions(); + throwables.addAll(0, suppressedExceptions); + CompoundRuntimeException.throwIfNotEmpty(throwables); } @NotNull diff --git a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java index 700130f09e8a..f88a0f96853c 100644 --- a/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java @@ -106,6 +106,35 @@ public abstract class UsefulTestCase extends TestCase { } } + /** + * Pass here the exception you want to be thrown first + * E.g.
+   * {@code
+   *   void tearDown() {
+   *     try {
+   *       doTearDowns();
+   *     }
+   *     catch(Exception e) {
+   *       addSuppressedException(e);
+   *     }
+   *     finally {
+   *       super.tearDown();
+   *     }
+   *   }
+   * }
+   * 
+ * + */ + protected void addSuppressedException(@NotNull Throwable e) { + List list = mySuppressedExceptions; + if (list == null) { + mySuppressedExceptions = list = new SmartList<>(); + } + list.add(e); + } + private List mySuppressedExceptions; + + public UsefulTestCase() { } @@ -173,7 +202,7 @@ public abstract class UsefulTestCase extends TestCase { } }, () -> UIUtil.removeLeakingAppleListeners() - ).run(); + ).run(ObjectUtils.notNull(mySuppressedExceptions, Collections.emptyList())); } finally { super.tearDown(); diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/BaseFixture.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/BaseFixture.java index bbf66b2f4f9a..bd69ab352562 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/BaseFixture.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/BaseFixture.java @@ -19,11 +19,16 @@ import com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory; import com.intellij.openapi.Disposable; import com.intellij.openapi.util.Disposer; import com.intellij.testFramework.EdtTestUtil; +import com.intellij.testFramework.RunAll; import com.intellij.testFramework.UsefulTestCase; import com.intellij.testFramework.fixtures.IdeaTestFixture; +import com.intellij.util.ObjectUtils; +import com.intellij.util.SmartList; +import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.junit.Assert; +import java.util.List; import java.util.concurrent.TimeUnit; /** @@ -49,8 +54,10 @@ public class BaseFixture implements IdeaTestFixture { public void tearDown() throws Exception { Assert.assertTrue("setUp() has not been called", myInitialized); Assert.assertFalse("tearDown() already has been called", myDisposed); - UsefulTestCase.waitForAppLeakingThreads(10, TimeUnit.SECONDS); - disposeRootDisposable(); + new RunAll( + () -> UsefulTestCase.waitForAppLeakingThreads(10, TimeUnit.SECONDS), + () -> disposeRootDisposable() + ).run(ObjectUtils.notNull(mySuppressedExceptions, ContainerUtil.emptyList())); myDisposed = true; resetClassFields(getClass()); } @@ -80,4 +87,33 @@ public class BaseFixture implements IdeaTestFixture { public final Disposable getTestRootDisposable() { return myTestRootDisposable; } + + /** + * Pass here the exception you want to be thrown first + * E.g.
+   * {@code
+   *   void tearDown() {
+   *     try {
+   *       doTearDowns();
+   *     }
+   *     catch(Exception e) {
+   *       addSuppressedException(e);
+   *     }
+   *     finally {
+   *       super.tearDown();
+   *     }
+   *   }
+   * }
+   * 
+ * + */ + protected void addSuppressedException(@NotNull Throwable e) { + List list = mySuppressedExceptions; + if (list == null) { + mySuppressedExceptions = list = new SmartList<>(); + } + list.add(e); + } + private List mySuppressedExceptions; + } \ No newline at end of file diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java index c58baaed1997..4226810b6003 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java @@ -60,6 +60,9 @@ public class LightTempDirTestFixtureImpl extends BaseFixture implements TempDirT try { deleteAll(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/TempDirTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/TempDirTestFixtureImpl.java index 0db4ff05f09f..c26798be6d08 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/TempDirTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/TempDirTestFixtureImpl.java @@ -140,6 +140,9 @@ public class TempDirTestFixtureImpl extends BaseFixture implements TempDirTestFi WriteAction.runAndWait(() -> findOrCreateDir("").delete(this)); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java index 27ef62b8abbe..4d54a4a78dcc 100644 --- a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java +++ b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java @@ -83,6 +83,9 @@ public class VcsLogRefresherTest extends VcsPlatformTest { fail("Only one refresh should have happened, an error happened instead: " + myDataWaiter.getExceptionText()); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java index aa41262b7b86..608a65dec957 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java @@ -62,6 +62,9 @@ public class DirectoryMappingListTest extends PlatformTestCase { myMappings.disposeMe(); ((AllVcses)myVcses).dispose(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java index 6687d42bb3f7..5d1842711775 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java @@ -87,6 +87,9 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { UsefulTestCase.clearDeclaredFields(this, IgnoreIdeaLevelTest.class); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dependency/SuspiciousPackagePrivateAccessInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dependency/SuspiciousPackagePrivateAccessInspectionTest.java index 04bc37ea0f20..fed29d115f44 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dependency/SuspiciousPackagePrivateAccessInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dependency/SuspiciousPackagePrivateAccessInspectionTest.java @@ -42,6 +42,9 @@ public class SuspiciousPackagePrivateAccessInspectionTest extends LightInspectio try { myProjectDescriptor.cleanUpSources(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/coverage/testSrc/com/intellij/coverage/CoverageAnnotatorIntegrationTest.java b/plugins/coverage/testSrc/com/intellij/coverage/CoverageAnnotatorIntegrationTest.java index 84e11a1250ed..7e5c989cc314 100644 --- a/plugins/coverage/testSrc/com/intellij/coverage/CoverageAnnotatorIntegrationTest.java +++ b/plugins/coverage/testSrc/com/intellij/coverage/CoverageAnnotatorIntegrationTest.java @@ -128,6 +128,9 @@ public class CoverageAnnotatorIntegrationTest extends ModuleTestCase { try { myCompilerTester.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/properties/testSrc/com/intellij/lang/properties/PropertiesCharsetTest.java b/plugins/properties/testSrc/com/intellij/lang/properties/PropertiesCharsetTest.java index 6667fa894641..ca799a6d7bcc 100644 --- a/plugins/properties/testSrc/com/intellij/lang/properties/PropertiesCharsetTest.java +++ b/plugins/properties/testSrc/com/intellij/lang/properties/PropertiesCharsetTest.java @@ -46,6 +46,9 @@ public class PropertiesCharsetTest extends CodeInsightTestCase { EncodingManager.getInstance().setDefaultCharsetName(myOldCharset.name()); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java b/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java index 5144f4b1bced..7e72ce624009 100644 --- a/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java +++ b/xml/tests/src/com/intellij/codeInsight/completion/XmlCompletionTest.java @@ -62,6 +62,9 @@ public class XmlCompletionTest extends LightCodeInsightFixtureTestCase { try { ExternalResourceManagerEx.getInstanceEx().setDefaultHtmlDoctype(myOldDoctype, getProject()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java index b9a6d3a09c65..987651ea9911 100644 --- a/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java +++ b/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java @@ -2209,6 +2209,9 @@ public class XmlHighlightingTest extends DaemonAnalyzerTestCase { try { XmlSettings.getInstance().SHOW_XML_ADD_IMPORT_HINTS = old; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/xml/tests/src/com/intellij/editor/XmlHighlighterTest.java b/xml/tests/src/com/intellij/editor/XmlHighlighterTest.java index f1ef7bb305d9..7356fc48e367 100644 --- a/xml/tests/src/com/intellij/editor/XmlHighlighterTest.java +++ b/xml/tests/src/com/intellij/editor/XmlHighlighterTest.java @@ -43,6 +43,9 @@ public class XmlHighlighterTest extends LightCodeInsightTestCase { EditorFactory.getInstance().releaseEditor(editor); editor = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java b/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java index 5e645c81ce74..a605dd2ac07d 100644 --- a/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java +++ b/xml/tests/src/com/intellij/xml/structureView/HtmlFileStructureTest.java @@ -40,6 +40,9 @@ public class HtmlFileStructureTest extends FileStructureTestBase { try { PropertiesComponent.getInstance().setValue(getHtml5OutlineModePropertyName(), myHtml5OutlineModeDefault); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); }