From 4b4257adf9102edf4376d059dbb2122ca28d894b Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 20 Aug 2014 19:02:49 +0400 Subject: [PATCH] Change executor Id to default one. It prevents NullPointerException because of missed runner. --- .../jet/plugin/run/RunConfigurationTest.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/idea/tests/org/jetbrains/jet/plugin/run/RunConfigurationTest.kt b/idea/tests/org/jetbrains/jet/plugin/run/RunConfigurationTest.kt index f2db12363d1..28168306f40 100644 --- a/idea/tests/org/jetbrains/jet/plugin/run/RunConfigurationTest.kt +++ b/idea/tests/org/jetbrains/jet/plugin/run/RunConfigurationTest.kt @@ -46,11 +46,11 @@ import org.jetbrains.jet.plugin.search.allScope import org.jetbrains.jet.plugin.refactoring.runWriteAction class RunConfigurationTest: CodeInsightTestCase() { - override fun getProject() = myProject!! + fun getTestProject() = myProject!! override fun getModule() = myModule!! fun testMainInTest() { - val createResult = configureModule(moduleDirPath("module"), getProject().getBaseDir()!!) + val createResult = configureModule(moduleDirPath("module"), getTestProject().getBaseDir()!!) val runConfiguration = createConfigurationFromMain("some.main") val javaParameters = getJavaRunParameters(runConfiguration) @@ -60,9 +60,9 @@ class RunConfigurationTest: CodeInsightTestCase() { } fun testDependencyModuleClasspath() { - val dependencyModuleSrcDir = configureModule(moduleDirPath("module"), getProject().getBaseDir()!!).src + val dependencyModuleSrcDir = configureModule(moduleDirPath("module"), getTestProject().getBaseDir()!!).src - val moduleWithDependencyDir = runWriteAction { getProject().getBaseDir()!!.createChildDirectory(this, "moduleWithDependency") }!! + val moduleWithDependencyDir = runWriteAction { getTestProject().getBaseDir()!!.createChildDirectory(this, "moduleWithDependency") }!! val moduleWithDependency = createModule("moduleWithDependency") ModuleRootModificationUtil.setModuleSdk(moduleWithDependency, getTestProjectJdk()) @@ -82,10 +82,10 @@ class RunConfigurationTest: CodeInsightTestCase() { } private fun createConfigurationFromMain(mainFqn: String): JetRunConfiguration { - val mainFunction = JetTopLevelFunctionsFqnNameIndex.getInstance()!!.get(mainFqn, getProject(), getProject().allScope())!!.first() + val mainFunction = JetTopLevelFunctionsFqnNameIndex.getInstance().get(mainFqn, getTestProject(), getTestProject().allScope()).first() val dataContext = MapDataContext() - dataContext.put(Location.DATA_KEY, PsiLocation(getProject(), mainFunction)) + dataContext.put(Location.DATA_KEY, PsiLocation(getTestProject(), mainFunction)) return ConfigurationContext.getFromContext(dataContext)!!.getConfiguration()!!.getConfiguration() as JetRunConfiguration } @@ -111,7 +111,7 @@ class RunConfigurationTest: CodeInsightTestCase() { Pair(srcOutDir, testOutDir) }!! - PsiDocumentManager.getInstance(getProject()).commitAllDocuments() + PsiDocumentManager.getInstance(getTestProject()).commitAllDocuments() return CreateModuleResult(configModule, srcOutDir, testOutDir) } @@ -134,7 +134,7 @@ class RunConfigurationTest: CodeInsightTestCase() { private class CreateModuleResult(val module: Module, val src: VirtualFile, val test: VirtualFile) private object MockExecutor : DefaultRunExecutor() { - override fun getId() = "mock" + override fun getId() = DefaultRunExecutor.EXECUTOR_ID } private object MockProfile : RunProfile {