use of com.intellij.execution.configurations.ParametersList in project intellij-community by JetBrains.
the class RestCommandLineState method buildCommandLineParameters.
@Override
protected void buildCommandLineParameters(GeneralCommandLine commandLine) {
ParametersList parametersList = commandLine.getParametersList();
ParamsGroup exeOptions = parametersList.getParamsGroup(GROUP_EXE_OPTIONS);
assert exeOptions != null;
exeOptions.addParametersString(myConfiguration.getInterpreterOptions());
ParamsGroup scriptParameters = parametersList.getParamsGroup(GROUP_SCRIPT);
assert scriptParameters != null;
getRunner().addToGroup(scriptParameters, commandLine);
final String key = getKey();
if (key != null)
scriptParameters.addParameter(key);
scriptParameters.addParameter(getTask());
final String params = myConfiguration.getParams();
if (params != null)
scriptParameters.addParametersString(params);
if (!StringUtil.isEmptyOrSpaces(myConfiguration.getInputFile()))
scriptParameters.addParameter(myConfiguration.getInputFile());
if (!StringUtil.isEmptyOrSpaces(myConfiguration.getOutputFile()))
scriptParameters.addParameter(myConfiguration.getOutputFile());
if (!StringUtil.isEmptyOrSpaces(myConfiguration.getWorkingDirectory()))
commandLine.setWorkDirectory(myConfiguration.getWorkingDirectory());
}
use of com.intellij.execution.configurations.ParametersList in project intellij-community by JetBrains.
the class ParametersListTest method paramsGroupAdd.
@Test
public void paramsGroupAdd() {
ParametersList params = new ParametersList();
ParamsGroup group1 = params.addParamsGroup("id1");
assertEquals("id1", group1.getId());
assertEquals(1, params.getParamsGroupsCount());
assertEquals(asList(group1), params.getParamsGroups());
ParamsGroup group2 = params.addParamsGroup("id2");
assertEquals("id2", group2.getId());
assertEquals(2, params.getParamsGroupsCount());
assertEquals(asList(group1, group2), params.getParamsGroups());
}
use of com.intellij.execution.configurations.ParametersList in project intellij-community by JetBrains.
the class ParametersListTest method paramsGroupRemove.
@Test
public void paramsGroupRemove() {
ParametersList params = new ParametersList();
params.addParamsGroup("id1");
ParamsGroup group2 = params.addParamsGroup("id2");
ParamsGroup group3 = params.addParamsGroup("id3");
ParamsGroup group4 = params.addParamsGroup("id4");
params.removeParamsGroup(0);
assertEquals(asList(group2, group3, group4), params.getParamsGroups());
params.removeParamsGroup(1);
assertEquals(asList(group2, group4), params.getParamsGroups());
}
use of com.intellij.execution.configurations.ParametersList 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.ParametersList in project intellij-community by JetBrains.
the class ParametersListTest method checkTokenizer.
private static void checkTokenizer(String paramString, String... expected) {
ParametersList params = new ParametersList();
params.addParametersString(paramString);
assertEquals(asList(expected), params.getList());
List<String> lines = ParametersListUtil.parse(paramString, true);
assertEquals(paramString, StringUtil.join(lines, " "));
}
Aggregations