Skip to content

Commit

Permalink
Use absolute paths to locate existed projects to open in AbstractConf…
Browse files Browse the repository at this point in the history
…igureKotlinTest
  • Loading branch information
vladimirdolzhenko authored and demiurg906 committed Nov 28, 2020
1 parent 124888e commit 3d33ea7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand All @@ -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())
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3d33ea7

Please sign in to comment.