@NotNull
 public static Icon getRawIcon(RunnerAndConfigurationSettings settings) {
   RunConfiguration configuration = settings.getConfiguration();
   ConfigurationFactory factory = settings.getFactory();
   Icon icon = factory != null ? factory.getIcon(configuration) : null;
   if (icon == null) icon = AllIcons.RunConfigurations.Unknown;
   return icon;
 }
  @Test
  public void template() {
    final Project project = mock(Project.class);

    final ConfigurationFactory configurationFactory = new RRunConfigurationType().getMainFactory();
    final RRunConfiguration templateConfiguration =
        (RRunConfiguration) configurationFactory.createTemplateConfiguration(project);

    assertEquals("", templateConfiguration.getScriptPath());
    assertEquals("", templateConfiguration.getScriptArgs());
    assertEquals("", templateConfiguration.getWorkingDirectoryPath());
    assertEquals(Collections.emptyMap(), templateConfiguration.getEnvs());
    assertEquals(true, templateConfiguration.isPassParentEnvs());
  }
Exemple #3
0
 @NotNull
 protected static ConfigurationFactory findFactory(
     ConfigurationType configurationType, @NonNls String configurationFactoryClassName) {
   for (ConfigurationFactory factory :
       Sequence.fromIterable(Sequence.fromArray(configurationType.getConfigurationFactories()))) {
     if (factory.getClass().getName().equals(configurationFactoryClassName)) {
       return factory;
     }
   }
   if (LOG.isEnabledFor(Priority.WARN)) {
     LOG.warn(
         "Cound not find configuration factory for "
             + configurationFactoryClassName
             + " in type "
             + configurationType.getDisplayName()
             + ".");
   }
   return configurationType.getConfigurationFactories()[0];
 }