summaryrefslogtreecommitdiff
path: root/test-framework
diff options
context:
space:
mode:
authorYan Zhulanow <yan.zhulanow@jetbrains.com>2020-08-20 19:08:29 +0900
committerkotlin-ide-monorepo-bot <kotlin-ide-monorepo-bot-no-reply@jetbrains.com>2020-08-21 10:32:48 +0000
commitf753c8021246637f272e5c572e555396b833052a (patch)
treee544dd322a6f51cedc6595fbc2ad64a3f9e78932 /test-framework
parent6d12b1e346daf67c7af4a6918dce8a3619a5f0b1 (diff)
downloadintellij-kotlin-f753c8021246637f272e5c572e555396b833052a.tar.gz
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
Diffstat (limited to 'test-framework')
-rw-r--r--test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt2
-rw-r--r--test-framework/test/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java4
-rw-r--r--test-framework/test/org/jetbrains/kotlin/idea/test/testUtils.kt4
3 files changed, 5 insertions, 5 deletions
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<DiagnosticFactory<*>> = emptySet()): String {
val text = text
if (InTextDirectivesUtils.isDirectiveDefined(text, "// DISABLE-ERRORS")) return text