From f753c8021246637f272e5c572e555396b833052a Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 20 Aug 2020 19:08:29 +0900 Subject: Move IDEA_TEST_DATA_DIR from PluginTestCaseBase PluginTestCaseBase contains erroneous code for getting mock JDKs, and it should be deleted. Moving a widely used constant is a first step. GitOrigin-RevId: 102d341a397e9e68474e6b81a3d7938335aaf49f --- .../kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt | 2 +- .../test/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java | 4 ---- test-framework/test/org/jetbrains/kotlin/idea/test/testUtils.kt | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test-framework') diff --git a/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 10bdce7455f2..685d6f85eac5 100644 --- a/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -185,7 +185,7 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix } return when { withLibraryDirective.isNotEmpty() -> - SdkAndMockLibraryProjectDescriptor(PluginTestCaseBase.IDEA_TEST_DATA_DIR.resolve(withLibraryDirective[0]).path, true) + SdkAndMockLibraryProjectDescriptor(IDEA_TEST_DATA_DIR.resolve(withLibraryDirective[0]).path, true) InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_SOURCES") -> ProjectDescriptorWithStdlibSources.INSTANCE diff --git a/test-framework/test/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java b/test-framework/test/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java index dfd15a766ba7..351ed5a4d2d5 100644 --- a/test-framework/test/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java +++ b/test-framework/test/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java @@ -27,16 +27,12 @@ import kotlin.jvm.functions.Function0; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.TestOnly; import org.jetbrains.kotlin.idea.util.IjPlatformUtil; -import org.jetbrains.kotlin.test.KotlinRoot; import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.TestJdkKind; import java.io.File; public class PluginTestCaseBase { - @NotNull - public static final File IDEA_TEST_DATA_DIR = new File(KotlinRoot.DIR, "idea/testData"); - private PluginTestCaseBase() { } diff --git a/test-framework/test/org/jetbrains/kotlin/idea/test/testUtils.kt b/test-framework/test/org/jetbrains/kotlin/idea/test/testUtils.kt index e821e872a031..249152bd61a0 100644 --- a/test-framework/test/org/jetbrains/kotlin/idea/test/testUtils.kt +++ b/test-framework/test/org/jetbrains/kotlin/idea/test/testUtils.kt @@ -17,9 +17,13 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent import org.jetbrains.kotlin.idea.util.application.runWriteAction import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.test.InTextDirectivesUtils +import org.jetbrains.kotlin.test.KotlinRoot import java.io.File import java.util.* +@JvmField +val IDEA_TEST_DATA_DIR = File(KotlinRoot.DIR, "idea/testData") + fun KtFile.dumpTextWithErrors(ignoreErrors: Set> = emptySet()): String { val text = text if (InTextDirectivesUtils.isDirectiveDefined(text, "// DISABLE-ERRORS")) return text -- cgit v1.2.3