use of com.intellij.execution.junit2.configuration.JUnitConfigurable in project intellij-community by JetBrains.
the class JUnitConfiguration method getConfigurationEditor.
@Override
@NotNull
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
SettingsEditorGroup<JUnitConfiguration> group = new SettingsEditorGroup<>();
group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new JUnitConfigurable(getProject()));
JavaRunConfigurationExtensionManager.getInstance().appendEditors(this, group);
group.addEditor(ExecutionBundle.message("logs.tab.title"), new LogConfigurationPanel<>());
return group;
}
use of com.intellij.execution.junit2.configuration.JUnitConfigurable in project android by JetBrains.
the class AndroidJUnitConfiguration method getConfigurationEditor.
@Override
@NotNull
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
SettingsEditorGroup<AndroidJUnitConfiguration> group = new SettingsEditorGroup<>();
group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new JUnitConfigurable(getProject()));
JavaRunConfigurationExtensionManager.getInstance().appendEditors(this, group);
group.addEditor(ExecutionBundle.message("logs.tab.title"), new LogConfigurationPanel<>());
return group;
}
use of com.intellij.execution.junit2.configuration.JUnitConfigurable in project intellij-community by JetBrains.
the class ConfigurationsTest method testModulesSelector.
public void testModulesSelector() throws ConfigurationException {
if (PlatformTestUtil.COVERAGE_ENABLED_BUILD)
return;
Module module1 = getModule1();
Module module2 = getModule2();
JUnitConfigurable editor = new JUnitConfigurable(myProject);
try {
JUnitConfiguration configuration = createConfiguration(findTestA(module2));
// To get all the watchers installed.
editor.getComponent();
Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
JComboBox comboBox = editor.getModulesComponent();
configurable.reset();
assertFalse(configurable.isModified());
assertEquals(module2.getName(), ((Module) comboBox.getSelectedItem()).getName());
//no module
assertEquals(ModuleManager.getInstance(myProject).getModules().length + 1, comboBox.getModel().getSize());
comboBox.setSelectedItem(module1);
assertTrue(configurable.isModified());
configurable.apply();
assertFalse(configurable.isModified());
assertEquals(Collections.singleton(module1), ContainerUtilRt.newHashSet(configuration.getModules()));
} finally {
Disposer.dispose(editor);
}
}
use of com.intellij.execution.junit2.configuration.JUnitConfigurable in project intellij-community by JetBrains.
the class ConfigurationsTest method testEditJUnitConfiguration.
public void testEditJUnitConfiguration() throws ConfigurationException {
if (PlatformTestUtil.COVERAGE_ENABLED_BUILD)
return;
PsiClass testA = findTestA(getModule2());
JUnitConfiguration configuration = createConfiguration(testA);
JUnitConfigurable editor = new JUnitConfigurable(myProject);
try {
Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
configurable.reset();
final EditorTextFieldWithBrowseButton component = ((LabeledComponent<EditorTextFieldWithBrowseButton>) editor.getTestLocation(JUnitConfigurationModel.CLASS)).getComponent();
assertEquals(testA.getQualifiedName(), component.getText());
PsiClass otherTest = findClass(getModule2(), "test2.Test2");
component.setText(otherTest.getQualifiedName());
configurable.apply();
assertEquals(otherTest.getName(), configuration.getName());
String specialName = "My name";
configuration.setName(specialName);
configuration.setNameChangedByUser(true);
configurable.reset();
component.setText(testA.getQualifiedName());
configurable.apply();
assertEquals(specialName, configuration.getName());
} finally {
Disposer.dispose(editor);
}
}
Aggregations