Search in sources :

Example 6 with RunnerAndConfigurationSettingsImpl

use of com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl in project intellij-community by JetBrains.

the class ConfigurationsTest method testExternalizeJUnitConfiguration.

public void testExternalizeJUnitConfiguration() {
    Module module = getModule1();
    JUnitConfiguration oldRc = createConfiguration(findTestA(module));
    oldRc.setWorkingDirectory(module.getModuleFilePath());
    RunManagerImpl runManager = new RunManagerImpl(myProject, new AppPropertiesComponentImpl());
    Element element = new Element("configuration");
    new RunnerAndConfigurationSettingsImpl(runManager, oldRc, false).writeExternal(element);
    RunnerAndConfigurationSettingsImpl settings = new RunnerAndConfigurationSettingsImpl(runManager);
    settings.readExternal(element);
    JUnitConfiguration newRc = (JUnitConfiguration) settings.getConfiguration();
    checkTestObject(oldRc.getPersistentData().TEST_OBJECT, newRc);
    assertThat(newRc.getModules()).containsOnly(module);
    checkClassName(oldRc.getPersistentData().getMainClassName(), newRc);
}
Also used : AppPropertiesComponentImpl(com.intellij.ide.util.AppPropertiesComponentImpl) Element(org.jdom.Element) RunnerAndConfigurationSettingsImpl(com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl) Module(com.intellij.openapi.module.Module) RunManagerImpl(com.intellij.execution.impl.RunManagerImpl)

Example 7 with RunnerAndConfigurationSettingsImpl

use of com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl in project intellij-community by JetBrains.

the class ConfigurationRefactoringsTest method createJUnitConfiguration.

@Override
protected JUnitConfiguration createJUnitConfiguration(@NotNull PsiElement psiElement, @NotNull Class<? extends AbstractJavaTestConfigurationProducer> producerClass, @NotNull MapDataContext dataContext) {
    final JUnitConfiguration configuration = super.createJUnitConfiguration(psiElement, producerClass, dataContext);
    RunManagerEx.getInstanceEx(myProject).setTemporaryConfiguration(new RunnerAndConfigurationSettingsImpl(null, configuration, false));
    return configuration;
}
Also used : JUnitConfiguration(com.intellij.execution.junit.JUnitConfiguration) RunnerAndConfigurationSettingsImpl(com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl)

Aggregations

RunnerAndConfigurationSettingsImpl (com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl)7 JUnitConfiguration (com.intellij.execution.junit.JUnitConfiguration)3 DefaultRunExecutor (com.intellij.execution.executors.DefaultRunExecutor)2 RunManagerImpl (com.intellij.execution.impl.RunManagerImpl)2 Executor (com.intellij.execution.Executor)1 RunManagerEx (com.intellij.execution.RunManagerEx)1 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1 ConfigurationFactoryEx (com.intellij.execution.configuration.ConfigurationFactoryEx)1 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)1 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 JavaParameters (com.intellij.execution.configurations.JavaParameters)1 JUnitConfigurationType (com.intellij.execution.junit.JUnitConfigurationType)1 TestObject (com.intellij.execution.junit.TestObject)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)1 ProcessEvent (com.intellij.execution.process.ProcessEvent)1 ExecutionEnvironment (com.intellij.execution.runners.ExecutionEnvironment)1 ExecutionEnvironmentBuilder (com.intellij.execution.runners.ExecutionEnvironmentBuilder)1 ProgramRunner (com.intellij.execution.runners.ProgramRunner)1 AppPropertiesComponentImpl (com.intellij.ide.util.AppPropertiesComponentImpl)1