use of com.intellij.execution.RunManager in project intellij-community by JetBrains.
the class CreateAction method choosePolicy.
private static BaseCreatePolicy choosePolicy(final ConfigurationContext context) {
final RunnerAndConfigurationSettings configuration = context.findExisting();
if (configuration == null)
return CREATE_AND_EDIT;
final RunManager runManager = context.getRunManager();
if (runManager.getSelectedConfiguration() != configuration)
return SELECT;
if (configuration.isTemporary())
return SAVE;
return SELECTED_STABLE;
}
use of com.intellij.execution.RunManager in project intellij-community by JetBrains.
the class PluginModuleBuilder method commitModule.
@Nullable
@Override
public Module commitModule(@NotNull Project project, @Nullable ModifiableModuleModel model) {
Module module = super.commitModule(project, model);
if (module != null) {
RunManager runManager = RunManager.getInstance(project);
RunnerAndConfigurationSettings configuration = runManager.createRunConfiguration(DevKitBundle.message("run.configuration.title"), new PluginConfigurationType().getConfigurationFactories()[0]);
runManager.addConfiguration(configuration, false);
runManager.setSelectedConfiguration(configuration);
}
return module;
}
use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.
the class FlexMoveTest method testConfigUpdatedOnPackageMove.
@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnPackageMove() throws Exception {
FlexTestUtils.modifyBuildConfiguration(myModule, bc -> bc.setMainClass("foo.SomeClass"));
final RunManager runManager = RunManager.getInstance(myProject);
FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.SomeClass", "testSomething", true);
FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.SomeClass", "", true);
FlexTestUtils.createFlexUnitRunConfig(runManager, "foo", myModule, FlexUnitRunnerParameters.Scope.Package, "foo", "", "", true);
FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.SomeClass", true);
doTest("foo", "bar");
assertEquals("bar.foo.SomeClass", FlexBuildConfigurationManager.getInstance(myModule).getActiveConfiguration().getMainClass());
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass.testSomething()", "", "bar.foo.SomeClass", "testSomething");
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass", "", "bar.foo.SomeClass", "");
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "bar.foo", "bar.foo", "", "");
FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "bar.foo.SomeClass");
}
use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.
the class FlexMoveTest method testConfigUpdatedOnClassMove.
@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnClassMove() throws Exception {
final RunManager runManager = RunManager.getInstance(myProject);
FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass.testSomething()", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.bar.SomeClass", "testSomething", true);
FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.bar.SomeClass", "", true);
FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass", true);
doTest("foo/bar/SomeClass.mxml", "");
//assertEquals("SomeClass", config.MAIN_CLASS);
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass.testSomething()", "", "SomeClass", "testSomething");
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "SomeClass", "", "SomeClass", "");
FlexTestUtils.checkFlashRunConfig(runManager, myModule, "SomeClass", "SomeClass");
}
use of com.intellij.execution.RunManager in project intellij-plugins by JetBrains.
the class FlexRenameTest method testConfigUpdatedOnClassRename.
@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testConfigUpdatedOnClassRename() throws Exception {
FlexTestUtils.modifyBuildConfiguration(myModule, bc -> bc.setMainClass("foo.bar.SomeClass"));
final RunManager runManager = RunManager.getInstance(myProject);
FlexTestUtils.createFlexUnitRunConfig(runManager, "Own name", myModule, FlexUnitRunnerParameters.Scope.Method, "", "foo.bar.SomeClass", "testSomething", false);
FlexTestUtils.createFlexUnitRunConfig(runManager, "SomeClass", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.bar.SomeClass", "", true);
FlexTestUtils.createFlexUnitRunConfig(runManager, "Same class short name", myModule, FlexUnitRunnerParameters.Scope.Class, "", "foo.SomeClass", "", false);
FlexTestUtils.createFlashRunConfig(runManager, myModule, "SomeClass", "foo.bar.SomeClass", true);
doTest("Renamed", "as");
assertEquals("foo.bar.Renamed", FlexBuildConfigurationManager.getInstance(myModule).getActiveConfiguration().getMainClass());
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "Own name", "", "foo.bar.Renamed", "testSomething");
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "Renamed", "", "foo.bar.Renamed", "");
FlexTestUtils.checkFlexUnitRunConfig(runManager, myModule, "Same class short name", "", "foo.SomeClass", "");
FlexTestUtils.checkFlashRunConfig(runManager, myModule, "Renamed", "foo.bar.Renamed");
}
Aggregations