From 3d33ea7da8edeb422dc7a8c4d64823176022cef8 Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Wed, 25 Nov 2020 16:50:04 +0100 Subject: [PATCH] Use absolute paths to locate existed projects to open in AbstractConfigureKotlinTest --- .../configuration/AbstractConfigureKotlinTest.kt | 13 ++++--------- .../AbstractConfigureKotlinTest.kt.201 | 7 ++++--- .../AbstractConfigureKotlinTest.kt.203 | 7 ++++--- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt index 46c7584068cbd..7b4f64b7cd90b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt @@ -19,7 +19,6 @@ import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess import com.intellij.testFramework.PlatformTestCase import com.intellij.testFramework.UsefulTestCase import junit.framework.TestCase -import junit.framework.TestResult import org.jetbrains.kotlin.idea.configuration.KotlinWithLibraryConfigurator.FileState import org.jetbrains.kotlin.idea.framework.KotlinSdkType import org.jetbrains.kotlin.idea.test.PluginTestCaseBase.* @@ -38,11 +37,6 @@ abstract class AbstractConfigureKotlinTest : PlatformTestCase() { VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()) } - override fun run(result: TestResult?) { - // TODO: [VD] temporary ignore/disable these tests - // super.run(result) - } - @Throws(Exception::class) override fun tearDown() { VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) @@ -111,9 +105,10 @@ abstract class AbstractConfigureKotlinTest : PlatformTestCase() { get() = ModuleManager.getInstance(myProject).modules override fun getProjectDirOrFile(): Path { - val projectFilePath = projectRoot + "/projectFile.ipr" - TestCase.assertTrue("Project file should exists " + projectFilePath, File(projectFilePath).exists()) - return File(projectFilePath).toPath() + val projectFilePath = "$projectRoot/projectFile.ipr" + val file = File(projectFilePath).absoluteFile + TestCase.assertTrue("Project file should exists $projectFilePath", file.exists()) + return file.toPath() } override fun doCreateProject(projectFile: Path): Project { diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.201 b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.201 index a5fc2e6856576..41cd2d4a75445 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.201 +++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.201 @@ -105,9 +105,10 @@ abstract class AbstractConfigureKotlinTest : PlatformTestCase() { get() = ModuleManager.getInstance(myProject).modules override fun getProjectDirOrFile(): Path { - val projectFilePath = projectRoot + "/projectFile.ipr" - TestCase.assertTrue("Project file should exists " + projectFilePath, File(projectFilePath).exists()) - return File(projectFilePath).toPath() + val projectFilePath = "$projectRoot/projectFile.ipr" + val file = File(projectFilePath).absoluteFile + TestCase.assertTrue("Project file should exists $projectFilePath", file.exists()) + return file.toPath() } override fun doCreateProject(projectFile: Path): Project { diff --git a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.203 b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.203 index ab9a09d4dfa90..1a020148c6f5f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.203 +++ b/idea/tests/org/jetbrains/kotlin/idea/configuration/AbstractConfigureKotlinTest.kt.203 @@ -106,9 +106,10 @@ abstract class AbstractConfigureKotlinTest : PlatformTestCase() { get() = ModuleManager.getInstance(myProject).modules override fun getProjectDirOrFile(isDirectoryBasedProject: Boolean): Path { - val projectFilePath = projectRoot + "/projectFile.ipr" - TestCase.assertTrue("Project file should exists " + projectFilePath, File(projectFilePath).exists()) - return File(projectFilePath).toPath() + val projectFilePath = "$projectRoot/projectFile.ipr" + val file = File(projectFilePath).absoluteFile + TestCase.assertTrue("Project file should exists $projectFilePath", file.exists()) + return file.toPath() } override fun doCreateAndOpenProject(): Project {