Search in sources :

Example 16 with ExecutionEnvironment

use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-community by JetBrains.

the class ExternalSystemBeforeRunTaskProvider method executeTask.

@Override
public boolean executeTask(DataContext context, RunConfiguration configuration, ExecutionEnvironment env, ExternalSystemBeforeRunTask beforeRunTask) {
    final ExternalSystemTaskExecutionSettings executionSettings = beforeRunTask.getTaskExecutionSettings();
    final List<ExternalTaskPojo> tasks = ContainerUtilRt.newArrayList();
    for (String taskName : executionSettings.getTaskNames()) {
        tasks.add(new ExternalTaskPojo(taskName, executionSettings.getExternalProjectPath(), null));
    }
    if (tasks.isEmpty())
        return true;
    ExecutionEnvironment environment = ExternalSystemUtil.createExecutionEnvironment(myProject, mySystemId, executionSettings, DefaultRunExecutor.EXECUTOR_ID);
    if (environment == null)
        return false;
    final ProgramRunner runner = environment.getRunner();
    environment.setExecutionId(env.getExecutionId());
    return RunConfigurationBeforeRunProvider.doRunTask(DefaultRunExecutor.getRunExecutorInstance().getId(), environment, runner);
}
Also used : ExternalTaskPojo(com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo) ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) ProgramRunner(com.intellij.execution.runners.ProgramRunner) ExternalSystemTaskExecutionSettings(com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings)

Example 17 with ExecutionEnvironment

use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-community by JetBrains.

the class GeneralToSMTRunnerEventsConvertorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    TestConsoleProperties consoleProperties = createConsoleProperties();
    TestConsoleProperties.HIDE_PASSED_TESTS.set(consoleProperties, false);
    TestConsoleProperties.OPEN_FAILURE_LINE.set(consoleProperties, false);
    TestConsoleProperties.SCROLL_TO_SOURCE.set(consoleProperties, false);
    TestConsoleProperties.SELECT_FIRST_DEFECT.set(consoleProperties, false);
    TestConsoleProperties.TRACK_RUNNING_TEST.set(consoleProperties, false);
    final ExecutionEnvironment environment = new ExecutionEnvironment();
    myMockResettablePrinter = new MockPrinter(true);
    myConsole = new MyConsoleView(consoleProperties, environment);
    myConsole.initUI();
    myResultsViewer = myConsole.getResultsViewer();
    myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
    myEventsProcessor.addEventsListener(myResultsViewer);
    myTreeModel = myResultsViewer.getTreeView().getModel();
    myEventsProcessor.onStartTesting();
}
Also used : ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) MockPrinter(com.intellij.execution.testframework.sm.runner.ui.MockPrinter) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Example 18 with ExecutionEnvironment

use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-community by JetBrains.

the class SMTestRunnerResultsFormTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myConsoleProperties = createConsoleProperties();
    TestConsoleProperties.HIDE_PASSED_TESTS.set(myConsoleProperties, false);
    TestConsoleProperties.OPEN_FAILURE_LINE.set(myConsoleProperties, false);
    TestConsoleProperties.SCROLL_TO_SOURCE.set(myConsoleProperties, false);
    TestConsoleProperties.SELECT_FIRST_DEFECT.set(myConsoleProperties, false);
    TestConsoleProperties.TRACK_RUNNING_TEST.set(myConsoleProperties, false);
    final ExecutionEnvironment environment = new ExecutionEnvironment();
    myConsole = new SMTRunnerConsoleView(myConsoleProperties);
    myConsole.initUI();
    myResultsViewer = myConsole.getResultsViewer();
    myTestsRootNode = myResultsViewer.getTestsRootNode();
    myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(myConsoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
    myEventsProcessor.addEventsListener(myResultsViewer);
    myTreeModel = myResultsViewer.getTreeView().getModel();
}
Also used : ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) GeneralToSMTRunnerEventsConvertor(com.intellij.execution.testframework.sm.runner.GeneralToSMTRunnerEventsConvertor)

Example 19 with ExecutionEnvironment

use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-community by JetBrains.

the class SMTRunnerConsoleTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    final TestConsoleProperties consoleProperties = createConsoleProperties();
    final ExecutionEnvironment environment = new ExecutionEnvironment();
    myMockResettablePrinter = new MockPrinter(true);
    myConsole = new MyConsoleView(consoleProperties, environment);
    myConsole.initUI();
    myResultsViewer = myConsole.getResultsViewer();
    myRootSuite = myResultsViewer.getTestsRootNode();
    myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
    myEventsProcessor.onStartTesting();
}
Also used : ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) MockPrinter(com.intellij.execution.testframework.sm.runner.ui.MockPrinter) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Example 20 with ExecutionEnvironment

use of com.intellij.execution.runners.ExecutionEnvironment in project intellij-community by JetBrains.

the class ToggleAutoTestAction method setSelected.

@Override
public void setSelected(AnActionEvent e, boolean state) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    RunContentDescriptor descriptor = e.getData(LangDataKeys.RUN_CONTENT_DESCRIPTOR);
    ExecutionEnvironment environment = e.getData(LangDataKeys.EXECUTION_ENVIRONMENT);
    if (project != null && descriptor != null && environment != null) {
        getAutoTestManager(project).setAutoTestEnabled(descriptor, environment, state);
    }
}
Also used : Project(com.intellij.openapi.project.Project) ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) RunContentDescriptor(com.intellij.execution.ui.RunContentDescriptor)

Aggregations

ExecutionEnvironment (com.intellij.execution.runners.ExecutionEnvironment)49 ProcessHandler (com.intellij.execution.process.ProcessHandler)13 ProcessEvent (com.intellij.execution.process.ProcessEvent)12 NotNull (org.jetbrains.annotations.NotNull)12 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)11 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)11 Project (com.intellij.openapi.project.Project)11 Nullable (org.jetbrains.annotations.Nullable)11 ProgramRunner (com.intellij.execution.runners.ProgramRunner)10 ExecutionException (com.intellij.execution.ExecutionException)9 Executor (com.intellij.execution.Executor)8 DefaultRunExecutor (com.intellij.execution.executors.DefaultRunExecutor)8 ExecutionEnvironmentBuilder (com.intellij.execution.runners.ExecutionEnvironmentBuilder)8 Key (com.intellij.openapi.util.Key)8 RunProfile (com.intellij.execution.configurations.RunProfile)7 Ref (com.intellij.openapi.util.Ref)7 DefaultDebugExecutor (com.intellij.execution.executors.DefaultDebugExecutor)6 Module (com.intellij.openapi.module.Module)6 IOException (java.io.IOException)5 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)4