From fb9562ca70b185190d7438fc9dbb375309edb6df Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Thu, 7 May 2020 18:19:49 +0700 Subject: [PATCH] Add `ThrowableRunnable` to fix CCE --- .../idea/test/KotlinLightCodeInsightFixtureTestCase.kt | 6 +++--- .../test/KotlinLightPlatformCodeInsightFixtureTestCase.kt | 7 ++++--- .../idea/test/KotlinLightPlatformCodeInsightTestCase.kt | 5 +++-- .../test/KotlinLightPlatformCodeInsightTestCase.kt.191 | 5 +++-- .../jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt | 7 ++++--- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 4e1176f29c1..73adbf7aaa4 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -106,9 +106,9 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix override fun tearDown() { runAll( - { LoggedErrorProcessor.restoreDefaultProcessor() }, - { disableKotlinOfficialCodeStyle(project) }, - { super.tearDown() }, + ThrowableRunnable { LoggedErrorProcessor.restoreDefaultProcessor() }, + ThrowableRunnable { disableKotlinOfficialCodeStyle(project) }, + ThrowableRunnable { super.tearDown() }, ) if (exceptions.isNotEmpty()) { diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt index 6fa57d006f1..53c4f8f9773 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt @@ -9,6 +9,7 @@ import com.intellij.ide.startup.impl.StartupManagerImpl import com.intellij.openapi.startup.StartupManager import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase +import com.intellij.util.ThrowableRunnable import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.TestMetadata import java.io.File @@ -24,9 +25,9 @@ abstract class KotlinLightPlatformCodeInsightFixtureTestCase : LightPlatformCode } override fun tearDown() = runAll( - { disableKotlinOfficialCodeStyle(project) }, - { VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) }, - { super.tearDown() }, + ThrowableRunnable { disableKotlinOfficialCodeStyle(project) }, + ThrowableRunnable { VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) }, + ThrowableRunnable { super.tearDown() }, ) protected fun testDataFile(fileName: String): File = File(testDataPath, fileName) diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt index 2c8acc78d38..22dc91b2bdd 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.idea.test import com.intellij.openapi.editor.Editor import com.intellij.openapi.project.Project import com.intellij.testFramework.LightPlatformCodeInsightTestCase +import com.intellij.util.ThrowableRunnable // BUNCH: 191 abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsightTestCase() { @@ -20,7 +21,7 @@ abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsight } override fun tearDown() = runAll( - { disableKotlinOfficialCodeStyle(project_) }, - { super.tearDown() }, + ThrowableRunnable { disableKotlinOfficialCodeStyle(project_) }, + ThrowableRunnable { super.tearDown() }, ) } \ No newline at end of file diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 index d8cdad46776..33a9961070a 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 @@ -9,6 +9,7 @@ import com.intellij.openapi.editor.Editor import com.intellij.openapi.project.Project import com.intellij.testFramework.LightPlatformCodeInsightTestCase import com.intellij.testFramework.LightPlatformTestCase +import com.intellij.util.ThrowableRunnable // BUNCH: 191 abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsightTestCase() { @@ -21,7 +22,7 @@ abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsight } override fun tearDown() = runAll( - { disableKotlinOfficialCodeStyle(project_) }, - { super.tearDown() }, + ThrowableRunnable { disableKotlinOfficialCodeStyle(project_) }, + ThrowableRunnable { super.tearDown() }, ) } \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt b/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt index 25c531f042e..aefa0064663 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/stubs/AbstractMultiModuleTest.kt @@ -23,6 +23,7 @@ import com.intellij.openapi.vfs.VfsUtil import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess import com.intellij.psi.PsiFile import com.intellij.testFramework.PsiTestUtil +import com.intellij.util.ThrowableRunnable import org.jetbrains.kotlin.config.CompilerSettings import org.jetbrains.kotlin.config.KotlinFacetSettings import org.jetbrains.kotlin.config.KotlinFacetSettingsProvider @@ -63,9 +64,9 @@ abstract class AbstractMultiModuleTest : DaemonAnalyzerTestCase() { } override fun tearDown() = runAll( - { VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) }, - { disableKotlinOfficialCodeStyle(project) }, - { super.tearDown() }, + ThrowableRunnable { VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) }, + ThrowableRunnable { disableKotlinOfficialCodeStyle(project) }, + ThrowableRunnable { super.tearDown() }, ) public override fun createModule(path: String, moduleType: ModuleType<*>): Module {