Search in sources :

Example 11 with ParamsGroup

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());
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) ParametersList(com.intellij.execution.configurations.ParametersList) Test(org.junit.Test)

Example 12 with ParamsGroup

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());
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) ParametersList(com.intellij.execution.configurations.ParametersList) Test(org.junit.Test)

Example 13 with ParamsGroup

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());
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) ParametersList(com.intellij.execution.configurations.ParametersList) Test(org.junit.Test)

Example 14 with ParamsGroup

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());
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) ParametersList(com.intellij.execution.configurations.ParametersList) Test(org.junit.Test)

Example 15 with ParamsGroup

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;
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine)

Aggregations

ParamsGroup (com.intellij.execution.configurations.ParamsGroup)18 ParametersList (com.intellij.execution.configurations.ParametersList)9 Test (org.junit.Test)6 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)4 BuildoutFacet (com.jetbrains.python.buildout.BuildoutFacet)2 ExecutionException (com.intellij.execution.ExecutionException)1 Project (com.intellij.openapi.project.Project)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 Course (com.jetbrains.edu.learning.courseFormat.Course)1 TaskFile (com.jetbrains.edu.learning.courseFormat.TaskFile)1 HelperPackage (com.jetbrains.python.HelperPackage)1 ReSTService (com.jetbrains.python.ReSTService)1 File (java.io.File)1 NotNull (org.jetbrains.annotations.NotNull)1