use of com.intellij.execution.configurations.ParamsGroup in project intellij-community by JetBrains.
the class ParametersListTest method paramsGroupClone.
@Test
public void paramsGroupClone() {
ParametersList params = new ParametersList();
ParamsGroup group1 = params.addParamsGroup("id1");
group1.addParameter("group1_param1");
ParamsGroup group2 = params.addParamsGroup("id2");
group2.addParameter("group2_param1");
ParamsGroup group3 = params.addParamsGroup("id3");
group3.addParameter("group3_param1");
ParametersList params_clone = params.clone();
params.removeParamsGroup(0);
group2.addParameter("group2_param2");
assertEquals("group2_param1 group2_param2 group3_param1", params.getParametersString().trim());
assertEquals("group1_param1 group2_param1 group3_param1", params_clone.getParametersString().trim());
}
use of com.intellij.execution.configurations.ParamsGroup in project intellij-community by JetBrains.
the class ParametersListTest method paramsGroupSubGroups.
@Test
public void paramsGroupSubGroups() {
ParametersList params = new ParametersList();
ParamsGroup group1 = params.addParamsGroup("id1");
group1.addParameter("group1_param1");
group1.addParameter("group1_param2");
ParamsGroup group2 = params.addParamsGroup("id2");
group2.addParameter("group2_param1");
ParamsGroup group1_1 = group1.getParametersList().addParamsGroup("id1_1");
group1_1.addParameter("group1_1_param1");
ParamsGroup group1_2 = group1.getParametersList().addParamsGroup("id1_2");
group1_2.addParameter("group1_2_param1");
assertEquals(asList("group1_param1", "group1_param2", "group1_1_param1", "group1_2_param1", "group2_param1"), params.getList());
assertEquals(asList("group1_param1", "group1_param2", "group1_1_param1", "group1_2_param1", "group2_param1"), params.getList());
assertEquals("group1_param1 group1_param2 group1_1_param1 group1_2_param1 group2_param1", params.getParametersString().trim());
}
use of com.intellij.execution.configurations.ParamsGroup in project intellij-community by JetBrains.
the class ParametersListTest method paramsGroupGroupParams.
@Test
public void paramsGroupGroupParams() {
ParametersList params = new ParametersList();
params.add("param1");
ParamsGroup group1 = params.addParamsGroup("id1");
group1.addParameter("group1_param1");
params.add("param2");
group1.addParameter("group1_param2");
ParamsGroup group2 = params.addParamsGroup("id2");
group2.addParameter("group2_param1");
params.add("param3");
assertEquals(asList("param1", "param2", "param3"), params.getParameters());
assertEquals(asList("param1", "param2", "param3", "group1_param1", "group1_param2", "group2_param1"), params.getList());
assertArrayEquals(new String[] { "param1", "param2", "param3", "group1_param1", "group1_param2", "group2_param1" }, params.getArray());
assertEquals("param1 param2 param3 group1_param1 group1_param2 group2_param1", params.getParametersString().trim());
ParametersList group1_params = group1.getParametersList();
assertEquals(asList("group1_param1", "group1_param2"), group1_params.getParameters());
assertEquals(asList("group1_param1", "group1_param2"), group1_params.getList());
assertArrayEquals(new String[] { "group1_param1", "group1_param2" }, group1_params.getArray());
assertEquals("group1_param1 group1_param2", group1_params.getParametersString().trim());
ParametersList group2_params = group2.getParametersList();
assertEquals(asList("group2_param1"), group2_params.getParameters());
assertEquals(asList("group2_param1"), group2_params.getList());
assertArrayEquals(new String[] { "group2_param1" }, group2_params.getArray());
assertEquals("group2_param1", group2_params.getParametersString().trim());
}
use of com.intellij.execution.configurations.ParamsGroup in project intellij-community by JetBrains.
the class ParametersListTest method paramsGroupAddAt.
@Test
public void paramsGroupAddAt() {
ParametersList params = new ParametersList();
ParamsGroup group1 = params.addParamsGroup("id1");
ParamsGroup group2 = params.addParamsGroup("id2");
ParamsGroup group12 = params.addParamsGroupAt(1, "id12");
ParamsGroup group01 = params.addParamsGroupAt(0, "id01");
assertEquals(asList(group01, group1, group12, group2), params.getParamsGroups());
}
use of com.intellij.execution.configurations.ParamsGroup in project intellij-community by JetBrains.
the class PythonTestCommandLineStateBase method generateCommandLine.
@Override
public GeneralCommandLine generateCommandLine() {
GeneralCommandLine cmd = super.generateCommandLine();
setWorkingDirectory(cmd);
ParamsGroup exe_options = cmd.getParametersList().getParamsGroup(GROUP_EXE_OPTIONS);
assert exe_options != null;
exe_options.addParametersString(myConfiguration.getInterpreterOptions());
addTestRunnerParameters(cmd);
return cmd;
}
Aggregations