Search in sources :

Example 1 with AppPropertiesComponentImpl

use of com.intellij.ide.util.AppPropertiesComponentImpl 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)

Aggregations

RunManagerImpl (com.intellij.execution.impl.RunManagerImpl)1 RunnerAndConfigurationSettingsImpl (com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl)1 AppPropertiesComponentImpl (com.intellij.ide.util.AppPropertiesComponentImpl)1 Module (com.intellij.openapi.module.Module)1 Element (org.jdom.Element)1