mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix default run configuration name IDEA-202077
This commit is contained in:
+6
-1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.externalSystem.service.execution;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.execution.configurations.ConfigurationFactory;
|
||||
import com.intellij.execution.configurations.ConfigurationType;
|
||||
import com.intellij.execution.configurations.RunConfiguration;
|
||||
@@ -143,7 +144,8 @@ public abstract class AbstractExternalSystemTaskConfigurationType implements Con
|
||||
}
|
||||
if (!StringUtil.isEmptyOrSpaces(projectName)) {
|
||||
buffer.append(projectName);
|
||||
} else {
|
||||
}
|
||||
else if (!StringUtil.isEmptyOrSpaces(externalProjectPath)) {
|
||||
buffer.append(externalProjectPath);
|
||||
}
|
||||
|
||||
@@ -161,6 +163,9 @@ public abstract class AbstractExternalSystemTaskConfigurationType implements Con
|
||||
}
|
||||
if (!isTasksAbsent) buffer.append(tasksPostfix);
|
||||
|
||||
if (buffer.length() == 0) {
|
||||
buffer.append(ExecutionBundle.message("run.configuration.unnamed.name.prefix"));
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.externalSystem.service.execution
|
||||
|
||||
import com.intellij.execution.ExecutionBundle
|
||||
import com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture
|
||||
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
|
||||
import junit.framework.TestCase
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
||||
class AbstractExternalSystemTaskConfigurationTypeTest : UsefulTestCase() {
|
||||
|
||||
private lateinit var myTestFixture: IdeaProjectTestFixture
|
||||
private lateinit var myProject: Project
|
||||
|
||||
@Before
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
myTestFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(name).fixture
|
||||
myTestFixture.setUp()
|
||||
myProject = myTestFixture.project
|
||||
}
|
||||
|
||||
@After
|
||||
override fun tearDown() {
|
||||
try {
|
||||
myTestFixture.tearDown()
|
||||
}
|
||||
finally {
|
||||
super.tearDown()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test correct name generated for empty task exec settings`() {
|
||||
val testSettings = ExternalSystemTaskExecutionSettings().apply {
|
||||
externalSystemIdString = "Test"
|
||||
}
|
||||
TestCase.assertEquals(ExecutionBundle.message("run.configuration.unnamed.name.prefix"),
|
||||
AbstractExternalSystemTaskConfigurationType.generateName(myProject,
|
||||
testSettings)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user