Change executor Id to default one. It prevents NullPointerException because of missed runner.

This commit is contained in:
Nikolay Krasko
2014-08-20 19:02:49 +04:00
parent 7d36fc7449
commit 4b4257adf9
@@ -46,11 +46,11 @@ import org.jetbrains.jet.plugin.search.allScope
import org.jetbrains.jet.plugin.refactoring.runWriteAction import org.jetbrains.jet.plugin.refactoring.runWriteAction
class RunConfigurationTest: CodeInsightTestCase() { class RunConfigurationTest: CodeInsightTestCase() {
override fun getProject() = myProject!! fun getTestProject() = myProject!!
override fun getModule() = myModule!! override fun getModule() = myModule!!
fun testMainInTest() { fun testMainInTest() {
val createResult = configureModule(moduleDirPath("module"), getProject().getBaseDir()!!) val createResult = configureModule(moduleDirPath("module"), getTestProject().getBaseDir()!!)
val runConfiguration = createConfigurationFromMain("some.main") val runConfiguration = createConfigurationFromMain("some.main")
val javaParameters = getJavaRunParameters(runConfiguration) val javaParameters = getJavaRunParameters(runConfiguration)
@@ -60,9 +60,9 @@ class RunConfigurationTest: CodeInsightTestCase() {
} }
fun testDependencyModuleClasspath() { 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") val moduleWithDependency = createModule("moduleWithDependency")
ModuleRootModificationUtil.setModuleSdk(moduleWithDependency, getTestProjectJdk()) ModuleRootModificationUtil.setModuleSdk(moduleWithDependency, getTestProjectJdk())
@@ -82,10 +82,10 @@ class RunConfigurationTest: CodeInsightTestCase() {
} }
private fun createConfigurationFromMain(mainFqn: String): JetRunConfiguration { 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() 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 return ConfigurationContext.getFromContext(dataContext)!!.getConfiguration()!!.getConfiguration() as JetRunConfiguration
} }
@@ -111,7 +111,7 @@ class RunConfigurationTest: CodeInsightTestCase() {
Pair(srcOutDir, testOutDir) Pair(srcOutDir, testOutDir)
}!! }!!
PsiDocumentManager.getInstance(getProject()).commitAllDocuments() PsiDocumentManager.getInstance(getTestProject()).commitAllDocuments()
return CreateModuleResult(configModule, srcOutDir, testOutDir) 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 class CreateModuleResult(val module: Module, val src: VirtualFile, val test: VirtualFile)
private object MockExecutor : DefaultRunExecutor() { private object MockExecutor : DefaultRunExecutor() {
override fun getId() = "mock" override fun getId() = DefaultRunExecutor.EXECUTOR_ID
} }
private object MockProfile : RunProfile { private object MockProfile : RunProfile {