From d4cba378ed3fccab9c40712aa4f3124d0dd91385 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 28 Nov 2018 20:57:55 +0300 Subject: [PATCH] handle suppressed exceptions --- .../test/ExternalSystemTestCase.java | 3 +++ .../console/ConsoleHistoryControllerTest.java | 4 +++- .../intellij/application/BadPluginTest.java | 3 +++ .../SelectionQuotingTypedHandlerTest.java | 3 +++ .../actions/ChangedLinesCounterTest.java | 3 +++ .../actions/ReformatFilesWithFiltersTest.java | 4 +++- .../ReformatOnlyVcsChangedTextTest.java | 6 +++++- .../impl/DuplexConsoleActionsTest.java | 3 +++ .../ProductivityFeaturesTest.java | 3 +++ .../history/core/LocalHistoryTestCase.java | 3 ++- .../history/integration/TestVirtualFile.java | 5 +++-- .../revertion/SelectionReverterTest.java | 15 ++++++++------- .../integration/ui/FileHistoryDialogTest.java | 19 ++++++++++--------- .../ui/SelectionHistoryDialogTest.java | 8 +++++--- .../editor/EditorPaintingTestCase.java | 3 +++ .../actions/CopyActionSimpleHandlerTest.java | 3 +++ .../editor/impl/AbstractEditorTest.java | 3 +++ .../impl/EditorColorsSchemeDelegateTest.java | 3 +++ .../impl/EditorLastActionTrackerTest.java | 4 +++- .../editor/impl/ImmediatePainterTest.java | 3 +++ .../fileEditor/NewDocumentHistoryTest.java | 3 +++ .../fileEditor/NonProjectFileAccessTest.java | 5 ++++- .../openapi/fileTypes/impl/FileTypesTest.java | 4 +++- .../vfs/impl/VirtualFilePointerRootsTest.java | 3 +++ ...ficationTrackerTreeChangesUpdatesTest.java | 4 +++- .../structuralsearch/SSRCodeInsightTest.java | 3 +++ .../intellij/util/io/storage/StorageTest.java | 9 +++++---- .../util/io/zip/UpdateableZipTest.java | 9 +++++---- .../com/intellij/openapi/vcs/Executor.java | 7 ++++--- .../intellij/xdebugger/XDebuggerTestCase.java | 3 +++ .../intelliLang/ReferenceInjectionTest.java | 3 +++ .../lang/ant/AntMultiFileCompletionTest.java | 3 +++ .../projectView/CommanderListBuilderTest.java | 3 +++ .../codeInsight/CreateClassFixTest.java | 3 +++ .../idea/eclipse/EclipseVarsTest.java | 3 +++ .../AppEngineCodeInsightTestCase.java | 3 +++ .../GradleProjectOpenProcessorTest.java | 7 +++++-- .../importing/GradleImportingTestCase.java | 3 +++ .../GradleSettingsImportingTest.java | 6 +++++- .../testSrc/hg4idea/test/HgPlatformTest.java | 3 +++ .../test/annotation/HgAnnotationTest.java | 3 +++ .../org/zmlx/hg4idea/test/HgHistoryTest.java | 13 +++++++------ ...onsistentResourceBundleInspectionTest.java | 4 +++- .../idea/maven/MavenImportingTestCase.java | 3 +++ .../jetbrains/idea/maven/MavenTestCase.java | 5 +++-- .../dom/MavenDomWithIndicesTestCase.java | 3 +++ .../execution/MavenRunConfigurationTest.java | 3 +++ .../importing/MavenShortcutsManagerTest.java | 3 +++ .../indices/MavenIndicesManagerTest.java | 3 +++ .../idea/maven/indices/MavenIndicesTest.java | 3 +++ .../maven/indices/MavenIndicesTestCase.java | 3 +++ .../MavenProjectIndicesManagerTest.java | 3 +++ .../idea/maven/indices/MavenSearcherTest.java | 3 +++ .../maven/plugins/MavenParameterGoalTest.java | 3 +++ .../project/MavenEmbeddersManagerTest.java | 3 +++ .../maven/project/MavenProjectReaderTest.java | 9 ++++----- .../MavenSurefireReportInConsoleTest.java | 3 +++ .../utils/MavenTemplateFileProcessorTest.java | 3 +++ .../maven/wizards/MavenImportWizardTest.java | 3 +++ .../idea/svn/SvnCachingRevisionsTest.java | 3 +++ .../intellij/tasks/TaskManagerTestCase.java | 3 +++ .../tasks/vcs/GitTaskBranchesTest.java | 6 +++++- .../com/intellij/tasks/vcs/TaskVcsTest.java | 4 +++- .../org/intellij/lang/xpath/TestBase.java | 3 +++ .../jetbrains/yaml/paste/YAMLPasteTest.java | 3 +++ .../rest/fixtures/RestFixtureTestCase.java | 3 +++ .../env/python/PyDynamicTypesTest.java | 3 ++- .../com/jetbrains/python/Py3ResolveTest.java | 3 +++ .../com/jetbrains/python/PyCopyPasteTest.java | 3 +++ .../PyFunctionTypeAnnotationParsingTest.java | 3 +++ .../com/jetbrains/python/PyQuickDocTest.java | 3 +++ .../com/jetbrains/python/PyTypingTest.java | 3 +++ .../com/jetbrains/python/PyWrapTest.java | 3 +++ .../jetbrains/python/fixtures/PyTestCase.java | 3 +++ .../python/intentions/PyIntentionTest.java | 4 +++- .../python/packaging/PyPackageCacheTest.java | 3 +++ .../python/pyi/PyiInspectionsTest.java | 3 +++ .../com/jetbrains/python/pyi/PyiTypeTest.java | 3 +++ .../refactoring/PyInvertBooleanTest.java | 2 +- .../python/refactoring/PyMoveTest.java | 3 +++ 80 files changed, 269 insertions(+), 62 deletions(-) diff --git a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java index e071526a8867..911ae6f68a59 100644 --- a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java +++ b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java @@ -166,6 +166,9 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase { myTestDir.deleteOnExit(); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); resetClassFields(getClass()); diff --git a/platform/lang-impl/testSources/com/intellij/execution/console/ConsoleHistoryControllerTest.java b/platform/lang-impl/testSources/com/intellij/execution/console/ConsoleHistoryControllerTest.java index d9b4a7b2ba66..5ee72b2bfbc1 100644 --- a/platform/lang-impl/testSources/com/intellij/execution/console/ConsoleHistoryControllerTest.java +++ b/platform/lang-impl/testSources/com/intellij/execution/console/ConsoleHistoryControllerTest.java @@ -133,10 +133,12 @@ public class ConsoleHistoryControllerTest extends LightPlatformCodeInsightTestCa @Override public void tearDown() throws Exception { try { - Disposer.dispose(myConsole); myVFile = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java b/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java index 3f319ac456a6..480bdd663bf4 100644 --- a/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java +++ b/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java @@ -60,6 +60,9 @@ public class BadPluginTest extends PlatformTestCase { try { System.setProperty(PathManager.PROPERTY_CONFIG_PATH, myOldConfigPath); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java index 621a4d592e6d..71da3e9b9813 100644 --- a/platform/platform-tests/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/application/options/codeInsight/editor/quotes/SelectionQuotingTypedHandlerTest.java @@ -55,6 +55,9 @@ public class SelectionQuotingTypedHandlerTest extends LightPlatformCodeInsightFi try { CodeInsightSettings.getInstance().SURROUND_SELECTION_ON_QUOTE_TYPED = myPrevValue; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ChangedLinesCounterTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ChangedLinesCounterTest.java index 33d1f7c7f5f3..a224520b4071 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ChangedLinesCounterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ChangedLinesCounterTest.java @@ -34,6 +34,9 @@ public class ChangedLinesCounterTest extends LightPlatformCodeInsightFixtureTest try { myFixture.getFile().putUserData(FormatChangedTextUtil.TEST_REVISION_CONTENT, null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java index a1523454b73e..1f93ac29f7bf 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java @@ -62,11 +62,13 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { } if (myWorkingDirectory != null) TestFileStructure.delete(myWorkingDirectory.getVirtualFile()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myRealCodeStyleManger = null; myMockCodeStyleManager = null; myMockPlainTextFormattingModelBuilder = null; - super.tearDown(); } } diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java index 6df772c5264c..4c1987d377da 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java @@ -112,7 +112,11 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { LanguageImportStatements.INSTANCE.removeExplicitExtension(PlainTextLanguage.INSTANCE, myMockPlainTextImportOptimizer); TestFileStructure.delete(myWorkingDirectory.getVirtualFile()); - } finally { + } + catch (Throwable e) { + addSuppressedException(e); + } + finally { myRealChangeListManager = null; myRealCodeStyleManger = null; myRealVcsContextFactory = null; diff --git a/platform/platform-tests/testSrc/com/intellij/execution/impl/DuplexConsoleActionsTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/DuplexConsoleActionsTest.java index 495be52ed834..d620ab5aff11 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/impl/DuplexConsoleActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/impl/DuplexConsoleActionsTest.java @@ -48,6 +48,9 @@ public class DuplexConsoleActionsTest extends LightPlatformTestCase { try { Disposer.dispose(myDisposable); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myDisposable = null; super.tearDown(); diff --git a/platform/platform-tests/testSrc/com/intellij/featureStatistics/ProductivityFeaturesTest.java b/platform/platform-tests/testSrc/com/intellij/featureStatistics/ProductivityFeaturesTest.java index 9c46f459a240..4fab29876fa2 100644 --- a/platform/platform-tests/testSrc/com/intellij/featureStatistics/ProductivityFeaturesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/featureStatistics/ProductivityFeaturesTest.java @@ -40,6 +40,9 @@ public class ProductivityFeaturesTest extends PlatformTestCase { myRegistry = null; myTracker = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/core/LocalHistoryTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/core/LocalHistoryTestCase.java index 047cee9b64cf..d56f41e175cf 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/core/LocalHistoryTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/history/core/LocalHistoryTestCase.java @@ -37,6 +37,7 @@ import org.junit.BeforeClass; import org.junit.Rule; import org.junit.rules.TestRule; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -53,7 +54,7 @@ public abstract class LocalHistoryTestCase extends Assert { } protected static byte[] b(String s) { - return s.getBytes(); + return s.getBytes(StandardCharsets.UTF_8); } protected static Content c(String data) { diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java b/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java index 13c094cdec19..b41d928a3537 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java @@ -27,6 +27,7 @@ import org.jetbrains.annotations.Nullable; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; @@ -99,13 +100,13 @@ public class TestVirtualFile extends VirtualFile { @Override public long getLength() { - return myContent == null ? 0 : myContent.getBytes().length; + return myContent == null ? 0 : myContent.getBytes(StandardCharsets.UTF_8).length; } @Override @NotNull public byte[] contentsToByteArray() { - return myContent == null ? ArrayUtil.EMPTY_BYTE_ARRAY : myContent.getBytes(); + return myContent == null ? ArrayUtil.EMPTY_BYTE_ARRAY : myContent.getBytes(StandardCharsets.UTF_8); } @Override diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java index 85ac9b9398e2..ec3c4b058d32 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/revertion/SelectionReverterTest.java @@ -28,6 +28,7 @@ import com.intellij.util.text.DateFormatUtil; import org.jetbrains.annotations.NotNull; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -54,8 +55,8 @@ public class SelectionReverterTest extends IntegrationTestCase { " public abstract bar();\n" + "}\n"; - setBinaryContent(f, before.getBytes()); - setBinaryContent(f, after.getBytes()); + setBinaryContent(f, before.getBytes(StandardCharsets.UTF_8)); + setBinaryContent(f, after.getBytes(StandardCharsets.UTF_8)); revertToPreviousRevision(2, 2); @@ -65,15 +66,15 @@ public class SelectionReverterTest extends IntegrationTestCase { " }\n" + " public abstract bar();\n" + "}\n"; - assertEquals(expected, new String(f.contentsToByteArray())); + assertEquals(expected, new String(f.contentsToByteArray(), StandardCharsets.UTF_8)); } public void testChangeSetName() throws Exception { long time = new Date(2001, 1, 11, 12, 30).getTime(); Clock.setTime(time); - setBinaryContent(f, "one".getBytes()); - setBinaryContent(f, "two".getBytes()); + setBinaryContent(f, "one".getBytes(StandardCharsets.UTF_8)); + setBinaryContent(f, "two".getBytes(StandardCharsets.UTF_8)); revertToPreviousRevision(0, 0); @@ -84,9 +85,9 @@ public class SelectionReverterTest extends IntegrationTestCase { public void testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile() throws Exception { createChildData(myRoot, "foo1.txt"); - setBinaryContent(f, "one".getBytes()); + setBinaryContent(f, "one".getBytes(StandardCharsets.UTF_8)); createChildData(myRoot, "foo2.txt"); - setBinaryContent(f, "two".getBytes()); + setBinaryContent(f, "two".getBytes(StandardCharsets.UTF_8)); createChildData(myRoot, "foo3.txt"); final List files = new ArrayList<>(); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java index 1a0fee6afabb..91c77ca58c4b 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java @@ -28,6 +28,7 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.text.DateFormatUtil; +import java.nio.charset.StandardCharsets; import java.util.Date; public class FileHistoryDialogTest extends LocalHistoryUITestCase { @@ -43,10 +44,10 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { long rightTime = new Date(2002 - 1900, 2, 4, 14, 0).getTime(); VirtualFile f = createChildData(myRoot, "old.txt"); - setBinaryContent(f, "old".getBytes(), -1, leftTime, this); + setBinaryContent(f, "old".getBytes(StandardCharsets.UTF_8), -1, leftTime, this); rename(f, "new.txt"); - setBinaryContent(f, "new".getBytes(), -1, rightTime, this); + setBinaryContent(f, "new".getBytes(StandardCharsets.UTF_8), -1, rightTime, this); byte[] content = new byte[0]; setBinaryContent(f, content); @@ -62,9 +63,9 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { public void testContent() { VirtualFile f = createChildData(myRoot, "f.txt"); - setBinaryContent(f, "old".getBytes()); - setBinaryContent(f, "new".getBytes()); - setBinaryContent(f, "current".getBytes()); + setBinaryContent(f, "old".getBytes(StandardCharsets.UTF_8)); + setBinaryContent(f, "new".getBytes(StandardCharsets.UTF_8)); + setBinaryContent(f, "current".getBytes(StandardCharsets.UTF_8)); FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 1); @@ -73,8 +74,8 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { public void testContentWhenOnlyOneRevisionSelected() { VirtualFile f = createChildData(myRoot, "f.txt"); - setBinaryContent(f, "old".getBytes()); - setBinaryContent(f, "new".getBytes()); + setBinaryContent(f, "old".getBytes(StandardCharsets.UTF_8)); + setBinaryContent(f, "new".getBytes(StandardCharsets.UTF_8)); FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 0); @@ -83,8 +84,8 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { public void testContentForCurrentRevision() { VirtualFile f = createChildData(myRoot, "f.txt"); - setBinaryContent(f, "old".getBytes()); - setBinaryContent(f, "current".getBytes()); + setBinaryContent(f, "old".getBytes(StandardCharsets.UTF_8)); + setBinaryContent(f, "current".getBytes(StandardCharsets.UTF_8)); FileHistoryDialogModel m = createFileModelAndSelectRevisions(f, 0, 0); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java index f363bb993ff8..1d63468fbed0 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java @@ -28,6 +28,8 @@ import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; +import java.nio.charset.StandardCharsets; + import static org.easymock.EasyMock.*; public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { @@ -40,9 +42,9 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { super.setUpInWriteAction(); f = createChildData(myRoot, "f.txt"); - setBinaryContent(f,"a\nb\nc\n".getBytes(), -1, 123,this); - setBinaryContent(f,"a\nbc\nc\nd\n".getBytes(), -1, 456,this); - setBinaryContent(f,"a\nbcd\nc\ne\n".getBytes(), -1, 789,this); + setBinaryContent(f, "a\nb\nc\n".getBytes(StandardCharsets.UTF_8), -1, 123, this); + setBinaryContent(f,"a\nbc\nc\nd\n".getBytes(StandardCharsets.UTF_8), -1, 456,this); + setBinaryContent(f,"a\nbcd\nc\ne\n".getBytes(StandardCharsets.UTF_8), -1, 789,this); } public void testDialogWorks() { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingTestCase.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingTestCase.java index 94d88d70b0e7..ce81af5ac5c4 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingTestCase.java @@ -61,6 +61,9 @@ public abstract class EditorPaintingTestCase extends AbstractEditorTest { try { FontLayoutService.setInstance(null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionSimpleHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionSimpleHandlerTest.java index f58b52498ec6..cbf02ad1a9cd 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionSimpleHandlerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionSimpleHandlerTest.java @@ -32,6 +32,9 @@ public class CopyActionSimpleHandlerTest extends CopyActionTest { try { CodeInsightSettings.getInstance().ADD_IMPORTS_ON_PASTE = myPrevValue; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java index b4739b5d127e..5bc84273bd2c 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java @@ -65,6 +65,9 @@ public abstract class AbstractEditorTest extends LightPlatformCodeInsightTestCas try { FontLayoutService.setInstance(null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java index a8209cdfb390..b37585d88c79 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java @@ -50,6 +50,9 @@ public class EditorColorsSchemeDelegateTest extends AbstractEditorTest { EditorColorsManager.getInstance().setGlobalScheme(mySavedScheme); ((EditorColorsManagerImpl)EditorColorsManager.getInstance()).getSchemeManager().removeScheme(myTestScheme); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myTestScheme = null; mySavedScheme = null; diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java index 6f1125c495cd..7e2277f129b9 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java @@ -48,10 +48,12 @@ public class EditorLastActionTrackerTest extends LightPlatformCodeInsightFixture try { EditorActionManager.getInstance().setActionHandler(SAMPLE_ACTION, mySavedHandler); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myTracker = null; mySavedHandler = null; - super.tearDown(); } } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java index 5bc17644b148..57431c454320 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java @@ -76,6 +76,9 @@ public class ImmediatePainterTest extends AbstractEditorTest { getDefaultColorScheme().setColor(EditorColors.CARET_COLOR, myDefaultCaretColor); KeyboardFocusManager.setCurrentKeyboardFocusManager(myDefaultFocusManager); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java index db5512dbf784..173cc8357b84 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java @@ -27,6 +27,9 @@ public class NewDocumentHistoryTest extends HeavyFileEditorManagerTestCase { try { Disposer.dispose(myHistory); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myHistory = null; super.tearDown(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java index aa133aa43a4c..3376b3bbe33a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java @@ -66,9 +66,12 @@ public class NonProjectFileAccessTest extends HeavyFileEditorManagerTestCase { } }); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); - ProjectManagerEx.getInstanceEx().unblockReloadingProjectOnExternalChanges(); // unblock only after project is disposed + ProjectManagerEx.getInstanceEx().unblockReloadingProjectOnExternalChanges(); // unblock only after project is disposed; } } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java index 4cb36965961a..67a162182717 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java @@ -71,9 +71,11 @@ public class FileTypesTest extends PlatformTestCase { FileTypeManagerImpl.reDetectAsync(false); ApplicationManager.getApplication().runWriteAction(() -> myFileTypeManager.setIgnoredFilesList(myOldIgnoredFilesList)); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myFileTypeManager = null; - super.tearDown(); } } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java index 8c625f4585c7..c02651cc8edf 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java @@ -53,6 +53,9 @@ public class VirtualFilePointerRootsTest extends PlatformTestCase { assertEquals(numberOfPointersBefore, myVirtualFilePointerManager.numberOfPointers()); assertEquals(numberOfListenersBefore, myVirtualFilePointerManager.numberOfListeners()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myVirtualFilePointerManager = null; super.tearDown(); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java b/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java index 92f9f2647c5a..6d9634c88ef3 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java @@ -40,9 +40,11 @@ public class PsiModificationTrackerTreeChangesUpdatesTest extends PlatformTestCa try { ((PsiManagerImpl)PsiManager.getInstance(getProject())).removeTreeChangePreprocessor(myTracker); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myTracker = null; - super.tearDown(); } } diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java index 2f945384c54c..632dac33f3a3 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSRCodeInsightTest.java @@ -33,6 +33,9 @@ public class SSRCodeInsightTest extends UsefulTestCase { try { myFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myFixture = null; myInspection = null; diff --git a/platform/util/testSrc/com/intellij/util/io/storage/StorageTest.java b/platform/util/testSrc/com/intellij/util/io/storage/StorageTest.java index 85e1ff6a435e..0c3cec0cef5e 100644 --- a/platform/util/testSrc/com/intellij/util/io/storage/StorageTest.java +++ b/platform/util/testSrc/com/intellij/util/io/storage/StorageTest.java @@ -24,12 +24,13 @@ import com.intellij.openapi.util.io.ByteArraySequence; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import java.nio.charset.StandardCharsets; public class StorageTest extends StorageTestBase { public void testSmoke() throws Exception { final int record = myStorage.createNewRecord(); - myStorage.writeBytes(record, new ByteArraySequence("Hello".getBytes()), false); - assertEquals("Hello", new String(myStorage.readBytes(record))); + myStorage.writeBytes(record, new ByteArraySequence("Hello".getBytes(StandardCharsets.UTF_8)), false); + assertEquals("Hello", new String(myStorage.readBytes(record), StandardCharsets.UTF_8)); } public void testStress() throws Exception { @@ -45,12 +46,12 @@ public class StorageTest extends StorageTestBase { for (int i = 0; i < count; i++) { final int record = myStorage.createNewRecord(); - myStorage.writeBytes(record, new ByteArraySequence(hello.getBytes()), true); // fixed size optimization is mor than 50 percents here! + myStorage.writeBytes(record, new ByteArraySequence(hello.getBytes(StandardCharsets.UTF_8)), true); // fixed size optimization is mor than 50 percents here! records[i] = record; } for (int record : records) { - assertEquals(hello, new String(myStorage.readBytes(record))); + assertEquals(hello, new String(myStorage.readBytes(record), StandardCharsets.UTF_8)); } long timedelta = System.currentTimeMillis() - start; diff --git a/platform/util/testSrc/com/intellij/util/io/zip/UpdateableZipTest.java b/platform/util/testSrc/com/intellij/util/io/zip/UpdateableZipTest.java index b0f6f9955a9c..5679ba824a66 100644 --- a/platform/util/testSrc/com/intellij/util/io/zip/UpdateableZipTest.java +++ b/platform/util/testSrc/com/intellij/util/io/zip/UpdateableZipTest.java @@ -24,6 +24,7 @@ import com.intellij.openapi.vfs.CharsetToolkit; import junit.framework.TestCase; import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.zip.CRC32; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -61,7 +62,7 @@ public class UpdateableZipTest extends TestCase { assertEntryWithContentExists(jbZip, "/second", "second"); JBZipEntry newEntry = jbZip.getOrCreateEntry("/third"); - newEntry.setData("third".getBytes()); + newEntry.setData("third".getBytes(StandardCharsets.UTF_8)); } try (ZipFile utilZip = new ZipFile(zipFile)) { @@ -79,7 +80,7 @@ public class UpdateableZipTest extends TestCase { assertEntryWithContentExists(jbZip, "/second", "second"); JBZipEntry newEntry = jbZip.getOrCreateEntry("/second"); - newEntry.setData("Content Replaced".getBytes()); + newEntry.setData("Content Replaced".getBytes(StandardCharsets.UTF_8)); } try (ZipFile utilZip = new ZipFile(zipFile)) { @@ -207,8 +208,8 @@ public class UpdateableZipTest extends TestCase { File zipFile = FileUtil.createTempFile("test", ".zip"); try (ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)))) { - appendEntry(zos, "/first", "first".getBytes()); - appendEntry(zos, "/second", "second".getBytes()); + appendEntry(zos, "/first", "first".getBytes(StandardCharsets.UTF_8)); + appendEntry(zos, "/second", "second".getBytes(StandardCharsets.UTF_8)); } return zipFile; } diff --git a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/Executor.java b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/Executor.java index 28e56ae40eb0..8510065a3842 100644 --- a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/Executor.java +++ b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/Executor.java @@ -24,6 +24,7 @@ import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -96,7 +97,7 @@ public class Executor { public static void echo(@NotNull String fileName, @NotNull String content) { try { - FileUtil.writeToFile(child(fileName), content.getBytes(), true); + FileUtil.writeToFile(child(fileName), content.getBytes(StandardCharsets.UTF_8), true); } catch (IOException e) { throw new RuntimeException(e); @@ -108,11 +109,11 @@ public class Executor { } public static void overwrite(@NotNull File file, @NotNull String content) throws IOException { - FileUtil.writeToFile(file, content.getBytes(), false); + FileUtil.writeToFile(file, content.getBytes(StandardCharsets.UTF_8), false); } public static void append(@NotNull File file, @NotNull String content) throws IOException { - FileUtil.writeToFile(file, content.getBytes(), true); + FileUtil.writeToFile(file, content.getBytes(StandardCharsets.UTF_8), true); } public static void append(@NotNull String fileName, @NotNull String content) throws IOException { diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestCase.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestCase.java index ad6274df1f5e..93b31085937a 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestCase.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestCase.java @@ -53,6 +53,9 @@ public abstract class XDebuggerTestCase extends PlatformTestCase { getBreakpointTypes().unregisterExtension(MY_LINE_BREAKPOINT_TYPE); getBreakpointTypes().unregisterExtension(MY_SIMPLE_BREAKPOINT_TYPE); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java b/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java index 9efe4cee7d62..f93e5cba5f66 100644 --- a/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java +++ b/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java @@ -249,6 +249,9 @@ public class ReferenceInjectionTest extends AbstractLanguageInjectionTestCase { try { myFixture.disableInspections(new InjectedReferencesInspection()); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java index eba2e4856f30..8064e83008d5 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java @@ -72,6 +72,9 @@ public class AntMultiFileCompletionTest extends UsefulTestCase { try { myFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myFixture = null; super.tearDown(); diff --git a/plugins/commander/test/com/intellij/projectView/CommanderListBuilderTest.java b/plugins/commander/test/com/intellij/projectView/CommanderListBuilderTest.java index 3c85a3a809e4..27b925a92d77 100644 --- a/plugins/commander/test/com/intellij/projectView/CommanderListBuilderTest.java +++ b/plugins/commander/test/com/intellij/projectView/CommanderListBuilderTest.java @@ -44,6 +44,9 @@ public class CommanderListBuilderTest extends BaseProjectViewTestCase { Disposer.dispose(myCommander); myCommander = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/CreateClassFixTest.java b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/CreateClassFixTest.java index ac16dc519544..2c88735de487 100644 --- a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/CreateClassFixTest.java +++ b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/codeInsight/CreateClassFixTest.java @@ -54,6 +54,9 @@ public class CreateClassFixTest extends UsefulTestCase { myFixture.tearDown(); myFixture = null; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java index 13142f0aca36..2eb37283bfed 100644 --- a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseVarsTest.java @@ -45,6 +45,9 @@ public abstract class EclipseVarsTest extends IdeaTestCase { PathMacros.getInstance().removeMacro(VARIABLE); PathMacros.getInstance().removeMacro(SRCVARIABLE); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/google-app-engine/testSource/com/intellij/appengine/AppEngineCodeInsightTestCase.java b/plugins/google-app-engine/testSource/com/intellij/appengine/AppEngineCodeInsightTestCase.java index e25d8b95f008..5f9989a0d99d 100644 --- a/plugins/google-app-engine/testSource/com/intellij/appengine/AppEngineCodeInsightTestCase.java +++ b/plugins/google-app-engine/testSource/com/intellij/appengine/AppEngineCodeInsightTestCase.java @@ -69,6 +69,9 @@ public abstract class AppEngineCodeInsightTestCase extends UsefulTestCase { try { myCodeInsightFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/gradle/java/testSources/importing/GradleProjectOpenProcessorTest.java b/plugins/gradle/java/testSources/importing/GradleProjectOpenProcessorTest.java index 3673d1e08111..5512916def2f 100644 --- a/plugins/gradle/java/testSources/importing/GradleProjectOpenProcessorTest.java +++ b/plugins/gradle/java/testSources/importing/GradleProjectOpenProcessorTest.java @@ -76,14 +76,17 @@ public class GradleProjectOpenProcessorTest extends GradleImportingTestCase { try { WriteAction.runAndWait(() -> { Arrays.stream(ProjectJdkTable.getInstance().getAllJdks()) - .filter(sdk -> !GRADLE_JDK_NAME.equals(sdk.getName())) - .forEach(ProjectJdkTable.getInstance()::removeJdk); + .filter(sdk -> !GRADLE_JDK_NAME.equals(sdk.getName())) + .forEach(ProjectJdkTable.getInstance()::removeJdk); for (Sdk sdk : removedSdks) { SdkConfigurationUtil.addSdk(sdk); } removedSdks.clear(); }); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java index 5621dfb06ad3..0ac719df231d 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java @@ -114,6 +114,9 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes Messages.setTestDialog(TestDialog.DEFAULT); deleteBuildSystemDirectory(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleSettingsImportingTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleSettingsImportingTest.java index d8a81e6853ae..10cbc5839737 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleSettingsImportingTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleSettingsImportingTest.java @@ -85,7 +85,11 @@ public class GradleSettingsImportingTest extends GradleImportingTestCase { public void tearDown() throws Exception { try { Registry.get(EXTERNAL_SYSTEM_CONFIGURATION_IMPORT_ENABLED).resetToDefault(); - } finally { + } + catch (Throwable e) { + addSuppressedException(e); + } + finally { super.tearDown(); } } diff --git a/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java b/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java index 86c397c1f0c1..87c604484f37 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java @@ -73,6 +73,9 @@ public abstract class HgPlatformTest extends VcsPlatformTest { try { myVcs.getGlobalSettings().setHgExecutable(null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java b/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java index dd7c597cb786..153e19435d38 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java @@ -49,6 +49,9 @@ public class HgAnnotationTest extends HgPlatformTest { try { Clock.reset(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java index c570a6db7cdf..c62e5daf7c91 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgHistoryTest.java @@ -9,6 +9,7 @@ import org.testng.annotations.Test; import org.zmlx.hg4idea.HgVcs; import java.io.File; +import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.List; @@ -44,8 +45,8 @@ public class HgHistoryTest extends HgSingleUserTest { assertEquals(revisions.size(), versions); assertTrue(session.isCurrentRevision(revisions.get(0).getRevisionNumber())); - assertEquals(revisions.get(0).loadContent(), UPDATED_FILE_CONTENT.getBytes()); - assertEquals(revisions.get(1).loadContent(), INITIAL_FILE_CONTENT.getBytes()); + assertEquals(revisions.get(0).loadContent(), UPDATED_FILE_CONTENT.getBytes(StandardCharsets.UTF_8)); + assertEquals(revisions.get(1).loadContent(), INITIAL_FILE_CONTENT.getBytes(StandardCharsets.UTF_8)); } /** @@ -78,8 +79,8 @@ public class HgHistoryTest extends HgSingleUserTest { assertEquals(revisions.size(), versions); assertTrue(session.isCurrentRevision(revisions.get(0).getRevisionNumber())); - assertEquals(revisions.get(0).loadContent(), UPDATED_FILE_CONTENT.getBytes()); - assertEquals(revisions.get(2).loadContent(), INITIAL_FILE_CONTENT.getBytes()); + assertEquals(revisions.get(0).loadContent(), UPDATED_FILE_CONTENT.getBytes(StandardCharsets.UTF_8)); + assertEquals(revisions.get(2).loadContent(), INITIAL_FILE_CONTENT.getBytes(StandardCharsets.UTF_8)); } @Test @@ -108,8 +109,8 @@ public class HgHistoryTest extends HgSingleUserTest { assertEquals(revisions.size(), versions); assertTrue(session.isCurrentRevision(revisions.get(0).getRevisionNumber())); - assertEquals(revisions.get(0).loadContent(), UPDATED_FILE_CONTENT.getBytes()); - assertEquals(revisions.get(1).loadContent(), INITIAL_FILE_CONTENT.getBytes()); + assertEquals(revisions.get(0).loadContent(), UPDATED_FILE_CONTENT.getBytes(StandardCharsets.UTF_8)); + assertEquals(revisions.get(1).loadContent(), INITIAL_FILE_CONTENT.getBytes(StandardCharsets.UTF_8)); } diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspectionTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspectionTest.java index 564a2fcf2781..72fbfe345af9 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspectionTest.java @@ -42,9 +42,11 @@ public class InconsistentResourceBundleInspectionTest extends JavaCodeInsightFix try { myInspection.clearSettings(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myInspection = null; - super.tearDown(); } } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenImportingTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenImportingTestCase.java index 5e0a00352970..2b0a8f614ed1 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenImportingTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenImportingTestCase.java @@ -68,6 +68,9 @@ public abstract class MavenImportingTestCase extends MavenTestCase { removeFromLocalRepository("test"); ExternalSystemTestCase.deleteBuildSystemDirectory(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myProjectsManager = null; myProjectsTree = null; diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java index c09f0e8d2e6c..6d9ee501489f 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java @@ -38,6 +38,7 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.List; import java.util.concurrent.TimeUnit; @@ -478,10 +479,10 @@ public abstract class MavenTestCase extends UsefulTestCase { try { WriteAction.runAndWait(() -> { if (advanceStamps) { - file.setBinaryContent(content.getBytes(), -1, file.getTimeStamp() + 4000); + file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8), -1, file.getTimeStamp() + 4000); } else { - file.setBinaryContent(content.getBytes(), file.getModificationStamp(), file.getTimeStamp()); + file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8), file.getModificationStamp(), file.getTimeStamp()); } }); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDomWithIndicesTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDomWithIndicesTestCase.java index 055ed916477b..a05a4b4ac8a4 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDomWithIndicesTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDomWithIndicesTestCase.java @@ -39,6 +39,9 @@ public abstract class MavenDomWithIndicesTestCase extends MavenDomTestCase { myIndicesFixture = null; } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java index 88af95fe7954..1f458cbf6fa6 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationTest.java @@ -31,6 +31,9 @@ public class MavenRunConfigurationTest extends IdeaTestCase { try { MavenServerManager.getInstance().shutdown(true); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenShortcutsManagerTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenShortcutsManagerTest.java index c0b1ca3b9763..577f8845681e 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenShortcutsManagerTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/MavenShortcutsManagerTest.java @@ -47,6 +47,9 @@ public class MavenShortcutsManagerTest extends MavenImportingTestCase { try { MavenKeymapExtension.clearActions(myProject); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myShortcutsManager = null; super.tearDown(); diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java index 191d51ab2d2e..0a2dabd3018e 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesManagerTest.java @@ -41,6 +41,9 @@ public class MavenIndicesManagerTest extends MavenIndicesTestCase { try { myIndicesFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTest.java index 8009a24350e7..c73cb1675401 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTest.java @@ -57,6 +57,9 @@ public class MavenIndicesTest extends MavenIndicesTestCase { try { shutdownIndices(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTestCase.java index 2dcabf332652..ed72d7d63aca 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenIndicesTestCase.java @@ -24,6 +24,9 @@ public abstract class MavenIndicesTestCase extends MavenImportingTestCase { try { MavenServerManager.getInstance().shutdown(true); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenProjectIndicesManagerTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenProjectIndicesManagerTest.java index cc16e9625e84..a7aa496d9124 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenProjectIndicesManagerTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenProjectIndicesManagerTest.java @@ -32,6 +32,9 @@ public class MavenProjectIndicesManagerTest extends MavenIndicesTestCase { try { myIndicesFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenSearcherTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenSearcherTest.java index f4feb87ed38f..8842cae4554a 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenSearcherTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenSearcherTest.java @@ -35,6 +35,9 @@ public class MavenSearcherTest extends MavenIndicesTestCase { try { myIndicesFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/plugins/MavenParameterGoalTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/plugins/MavenParameterGoalTest.java index 74dc0bb97d60..bcdb0296f26b 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/plugins/MavenParameterGoalTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/plugins/MavenParameterGoalTest.java @@ -27,6 +27,9 @@ public class MavenParameterGoalTest extends LightCodeInsightFixtureTestCase { try { MavenServerManager.getInstance().shutdown(true); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenEmbeddersManagerTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenEmbeddersManagerTest.java index 88c131355957..a7cda5f7eb53 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenEmbeddersManagerTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenEmbeddersManagerTest.java @@ -32,6 +32,9 @@ public class MavenEmbeddersManagerTest extends MavenTestCase { try { myManager.releaseForcefullyInTests(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java index ad3a898eb89a..ab02d7bfa33a 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectReaderTest.java @@ -15,7 +15,6 @@ */ package org.jetbrains.idea.maven.project; -import com.intellij.openapi.application.Result; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.util.SystemInfo; @@ -27,12 +26,12 @@ import com.intellij.testFramework.PlatformTestUtil; import com.intellij.util.ArrayUtil; import com.intellij.util.Function; import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.maven.MavenTestCase; import org.jetbrains.idea.maven.model.*; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -504,7 +503,7 @@ public class MavenProjectReaderTest extends MavenTestCase { parentFile.getParentFile().mkdirs(); FileUtil.writeToFile(parentFile, createPomXml("test" + "parent" + - "1").getBytes()); + "1").getBytes(StandardCharsets.UTF_8)); createProjectPom("test" + "not-a-project" + @@ -671,7 +670,7 @@ public class MavenProjectReaderTest extends MavenTestCase { "" + " value" + - "").getBytes()); + "").getBytes(StandardCharsets.UTF_8)); VirtualFile module = createModulePom("module", "" + @@ -776,7 +775,7 @@ public class MavenProjectReaderTest extends MavenTestCase { "" + " value" + - "").getBytes()); + "").getBytes(StandardCharsets.UTF_8)); createProjectPom("" + " org.test" + diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/tests/MavenSurefireReportInConsoleTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/tests/MavenSurefireReportInConsoleTest.java index 1de4f3a8e844..19eefda5a1fb 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/tests/MavenSurefireReportInConsoleTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/tests/MavenSurefireReportInConsoleTest.java @@ -42,6 +42,9 @@ public class MavenSurefireReportInConsoleTest extends LightCodeInsightFixtureTes try { MavenServerManager.getInstance().shutdown(true); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/utils/MavenTemplateFileProcessorTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/utils/MavenTemplateFileProcessorTest.java index 8ded1ce9e9b6..5842eaa96bd5 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/utils/MavenTemplateFileProcessorTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/utils/MavenTemplateFileProcessorTest.java @@ -44,6 +44,9 @@ public class MavenTemplateFileProcessorTest extends LightPlatformCodeInsightFixt try { MavenServerManager.getInstance().shutdown(true); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/wizards/MavenImportWizardTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/wizards/MavenImportWizardTest.java index d25cc4d44095..945382a80eba 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/wizards/MavenImportWizardTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/wizards/MavenImportWizardTest.java @@ -34,6 +34,9 @@ public class MavenImportWizardTest extends ProjectWizardTestCase { MavenServerManager.getInstance().shutdown(true); JavaAwareProjectJdkTableImpl.removeInternalJdkInTests(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java index 4f7d5d6b6dd0..a2376e988a52 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnCachingRevisionsTest.java @@ -45,6 +45,9 @@ public class SvnCachingRevisionsTest extends CodeInsightFixtureTestCase { myVcs = null; FileUtil.delete(SvnApplicationSettings.getLoadedRevisionsDir(myFixture.getProject())); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/TaskManagerTestCase.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/TaskManagerTestCase.java index 7053ee4bf3ea..775b965c55f5 100644 --- a/plugins/tasks/tasks-tests/test/com/intellij/tasks/TaskManagerTestCase.java +++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/TaskManagerTestCase.java @@ -49,6 +49,9 @@ public abstract class TaskManagerTestCase extends LightCodeInsightFixtureTestCas myTaskManager.setRepositories(Collections.emptyList()); removeAllTasks(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myTaskManager = null; super.tearDown(); diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/GitTaskBranchesTest.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/GitTaskBranchesTest.java index d6c28c0c7fdb..21afb07e292e 100644 --- a/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/GitTaskBranchesTest.java +++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/GitTaskBranchesTest.java @@ -47,7 +47,11 @@ public class GitTaskBranchesTest extends TaskBranchesTest { protected void tearDown() throws Exception { try { GitVcsSettings.getInstance(myProject).getAppSettings().setPathToGit(null); - } finally { + } + catch (Throwable e) { + addSuppressedException(e); + } + finally { super.tearDown(); } } diff --git a/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java b/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java index 2500eefff0e5..586778d7007b 100644 --- a/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java +++ b/plugins/tasks/tasks-tests/test/com/intellij/tasks/vcs/TaskVcsTest.java @@ -508,11 +508,13 @@ public class TaskVcsTest extends CodeInsightFixtureTestCase { myTaskManager.setRepositories(Collections.emptyList()); AllVcses.getInstance(getProject()).unregisterManually(myVcs); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myTaskManager = null; myVcs = null; myChangeListManager = null; - super.tearDown(); } } diff --git a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/TestBase.java b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/TestBase.java index 2be305069a26..11fea7cc8f09 100644 --- a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/TestBase.java +++ b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/TestBase.java @@ -55,6 +55,9 @@ public abstract class TestBase extends UsefulTestCase { try { myFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myFixture = null; super.tearDown(); diff --git a/plugins/yaml/testSrc/org/jetbrains/yaml/paste/YAMLPasteTest.java b/plugins/yaml/testSrc/org/jetbrains/yaml/paste/YAMLPasteTest.java index d053b36ef06c..0b02b2d18f8c 100644 --- a/plugins/yaml/testSrc/org/jetbrains/yaml/paste/YAMLPasteTest.java +++ b/plugins/yaml/testSrc/org/jetbrains/yaml/paste/YAMLPasteTest.java @@ -48,6 +48,9 @@ public abstract class YAMLPasteTest extends LightPlatformCodeInsightFixtureTestC try { CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = myDefaultReformatOnPaste; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/python-rest/test/com/jetbrains/rest/fixtures/RestFixtureTestCase.java b/python/python-rest/test/com/jetbrains/rest/fixtures/RestFixtureTestCase.java index 19bc4c2aa50b..f4a2fcda1f5d 100644 --- a/python/python-rest/test/com/jetbrains/rest/fixtures/RestFixtureTestCase.java +++ b/python/python-rest/test/com/jetbrains/rest/fixtures/RestFixtureTestCase.java @@ -40,6 +40,9 @@ public abstract class RestFixtureTestCase extends UsefulTestCase { try { myFixture.tearDown(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { myFixture = null; super.tearDown(); diff --git a/python/testSrc/com/jetbrains/env/python/PyDynamicTypesTest.java b/python/testSrc/com/jetbrains/env/python/PyDynamicTypesTest.java index 0678ee1134eb..da1897e3e90e 100644 --- a/python/testSrc/com/jetbrains/env/python/PyDynamicTypesTest.java +++ b/python/testSrc/com/jetbrains/env/python/PyDynamicTypesTest.java @@ -19,6 +19,7 @@ import com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor; import org.junit.Test; import java.io.IOException; +import java.nio.charset.StandardCharsets; /** * @author traff @@ -43,7 +44,7 @@ public class PyDynamicTypesTest extends PyEnvTestCase { @Override public void doFinally() { try { - PySignatureCacheManagerImpl.CALL_SIGNATURES_ATTRIBUTE.writeAttributeBytes(getVirtualFile(), "".getBytes()); + PySignatureCacheManagerImpl.CALL_SIGNATURES_ATTRIBUTE.writeAttributeBytes(getVirtualFile(), "".getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { //pass diff --git a/python/testSrc/com/jetbrains/python/Py3ResolveTest.java b/python/testSrc/com/jetbrains/python/Py3ResolveTest.java index 61a00195d0ac..54304ec32ae7 100644 --- a/python/testSrc/com/jetbrains/python/Py3ResolveTest.java +++ b/python/testSrc/com/jetbrains/python/Py3ResolveTest.java @@ -56,6 +56,9 @@ public class Py3ResolveTest extends PyResolveTestCase { try { PythonLanguageLevelPusher.setForcedLanguageLevel(myFixture.getProject(), null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java b/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java index 1d6f43daf2ef..98152ecb14ae 100644 --- a/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java +++ b/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java @@ -39,6 +39,9 @@ public class PyCopyPasteTest extends PyTestCase { try { CodeInsightSettings.getInstance().INDENT_TO_CARET_ON_PASTE = myOldEnabled; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/PyFunctionTypeAnnotationParsingTest.java b/python/testSrc/com/jetbrains/python/PyFunctionTypeAnnotationParsingTest.java index 387240005f59..fe87b62e87d1 100644 --- a/python/testSrc/com/jetbrains/python/PyFunctionTypeAnnotationParsingTest.java +++ b/python/testSrc/com/jetbrains/python/PyFunctionTypeAnnotationParsingTest.java @@ -43,6 +43,9 @@ public class PyFunctionTypeAnnotationParsingTest extends ParsingTestCase { PythonVisitorFilter.INSTANCE.removeExplicitExtension(PythonLanguage.INSTANCE, (visitorClass, file) -> false); PythonVisitorFilter.INSTANCE.removeExplicitExtension(PyFunctionTypeAnnotationDialect.INSTANCE, (visitorClass, file) -> false); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/PyQuickDocTest.java b/python/testSrc/com/jetbrains/python/PyQuickDocTest.java index f70e789598ca..5e662aa5ef6d 100644 --- a/python/testSrc/com/jetbrains/python/PyQuickDocTest.java +++ b/python/testSrc/com/jetbrains/python/PyQuickDocTest.java @@ -39,6 +39,9 @@ public class PyQuickDocTest extends LightMarkedTestCase { final PyDocumentationSettings documentationSettings = PyDocumentationSettings.getInstance(myFixture.getModule()); documentationSettings.setFormat(myFormat); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/PyTypingTest.java b/python/testSrc/com/jetbrains/python/PyTypingTest.java index 4936af73deb1..8dfa17593c77 100644 --- a/python/testSrc/com/jetbrains/python/PyTypingTest.java +++ b/python/testSrc/com/jetbrains/python/PyTypingTest.java @@ -53,6 +53,9 @@ public class PyTypingTest extends PyTestCase { try { setLanguageLevel(null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/PyWrapTest.java b/python/testSrc/com/jetbrains/python/PyWrapTest.java index e38b4d3e1b7a..2d32fc52d9b8 100644 --- a/python/testSrc/com/jetbrains/python/PyWrapTest.java +++ b/python/testSrc/com/jetbrains/python/PyWrapTest.java @@ -48,6 +48,9 @@ public class PyWrapTest extends PyTestCase { settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = myOldWrap; pythonSettings.RIGHT_MARGIN = myOldMargin; } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java index 787c322eab88..8001c10bf9dc 100644 --- a/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java +++ b/python/testSrc/com/jetbrains/python/fixtures/PyTestCase.java @@ -186,6 +186,9 @@ public abstract class PyTestCase extends UsefulTestCase { myFixture = null; FilePropertyPusher.EP_NAME.findExtensionOrFail(PythonLanguageLevelPusher.class).flushLanguageLevelCache(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); clearFields(this); diff --git a/python/testSrc/com/jetbrains/python/intentions/PyIntentionTest.java b/python/testSrc/com/jetbrains/python/intentions/PyIntentionTest.java index 87918941e2fb..2461900275a9 100644 --- a/python/testSrc/com/jetbrains/python/intentions/PyIntentionTest.java +++ b/python/testSrc/com/jetbrains/python/intentions/PyIntentionTest.java @@ -4,7 +4,6 @@ package com.jetbrains.python.intentions; import com.intellij.codeInsight.CodeInsightSettings; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.psi.PsiFile; -import com.intellij.testFramework.PsiTestUtil; import com.jetbrains.python.PyBundle; import com.jetbrains.python.codeInsight.PyCodeInsightSettings; import com.jetbrains.python.documentation.PyDocumentationSettings; @@ -36,6 +35,9 @@ public class PyIntentionTest extends PyTestCase { myDocumentationSettings.setFormat(DocStringFormat.PLAIN); } } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/packaging/PyPackageCacheTest.java b/python/testSrc/com/jetbrains/python/packaging/PyPackageCacheTest.java index c05579ec0655..0472fb27259f 100644 --- a/python/testSrc/com/jetbrains/python/packaging/PyPackageCacheTest.java +++ b/python/testSrc/com/jetbrains/python/packaging/PyPackageCacheTest.java @@ -32,6 +32,9 @@ public class PyPackageCacheTest extends PyTestCase { try { PyPIPackageCache.reset(); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/pyi/PyiInspectionsTest.java b/python/testSrc/com/jetbrains/python/pyi/PyiInspectionsTest.java index fe6696e1f5bc..959a2a2670f3 100644 --- a/python/testSrc/com/jetbrains/python/pyi/PyiInspectionsTest.java +++ b/python/testSrc/com/jetbrains/python/pyi/PyiInspectionsTest.java @@ -46,6 +46,9 @@ public class PyiInspectionsTest extends PyTestCase { PythonVisitorFilter.INSTANCE.removeExplicitExtension(PythonLanguage.INSTANCE, (visitorClass, file) -> false); PythonVisitorFilter.INSTANCE.removeExplicitExtension(PyiLanguageDialect.getInstance(), (visitorClass, file) -> false); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/pyi/PyiTypeTest.java b/python/testSrc/com/jetbrains/python/pyi/PyiTypeTest.java index e98bae6bbfe2..1bacd5e57b62 100644 --- a/python/testSrc/com/jetbrains/python/pyi/PyiTypeTest.java +++ b/python/testSrc/com/jetbrains/python/pyi/PyiTypeTest.java @@ -78,6 +78,9 @@ public class PyiTypeTest extends PyTestCase { } setLanguageLevel(null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); } diff --git a/python/testSrc/com/jetbrains/python/refactoring/PyInvertBooleanTest.java b/python/testSrc/com/jetbrains/python/refactoring/PyInvertBooleanTest.java index 6d0b18f59963..18311f742202 100644 --- a/python/testSrc/com/jetbrains/python/refactoring/PyInvertBooleanTest.java +++ b/python/testSrc/com/jetbrains/python/refactoring/PyInvertBooleanTest.java @@ -46,7 +46,7 @@ public class PyInvertBooleanTest extends PyTestCase { private void doTest(List files) { files.add(0, "refactoring/invertBoolean/" + getTestName(true) + ".before.py"); - myFixture.configureByFiles(files.toArray(ArrayUtil.EMPTY_STRING_ARRAY)); + myFixture.configureByFiles(ArrayUtil.toStringArray(files)); final PsiElement element = myFixture.getElementAtCaret(); assertTrue(element instanceof PsiNamedElement); diff --git a/python/testSrc/com/jetbrains/python/refactoring/PyMoveTest.java b/python/testSrc/com/jetbrains/python/refactoring/PyMoveTest.java index 80b0b08687cb..bcd013288724 100644 --- a/python/testSrc/com/jetbrains/python/refactoring/PyMoveTest.java +++ b/python/testSrc/com/jetbrains/python/refactoring/PyMoveTest.java @@ -60,6 +60,9 @@ public class PyMoveTest extends PyTestCase { try { SystemProperties.setTestUserName(null); } + catch (Throwable e) { + addSuppressedException(e); + } finally { super.tearDown(); }