Change executor Id to default one. It prevents NullPointerException because of missed runner.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user