use of com.intellij.execution.ui.ConsoleView in project buck by facebook.
the class TestExecutionState method execute.
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final ProcessHandler processHandler = runBuildCommand(executor);
final TestConsoleProperties properties = new BuckTestConsoleProperties(processHandler, mProject, mConfiguration, "Buck test", executor);
final ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("buck test", processHandler, properties);
return new DefaultExecutionResult(console, processHandler, AnAction.EMPTY_ARRAY);
}
use of com.intellij.execution.ui.ConsoleView in project intellij-elixir by KronicDeth.
the class MixExUnitRunningState method createAndAttachConsole.
/**
* Unifies the interface for {@code SMTestRunnerConnectionUtil.createAndAttachConsole} between 141 and later releases
*/
private ConsoleView createAndAttachConsole(@NotNull String testFrameworkName, @NotNull ProcessHandler processHandler, @NotNull TestConsoleProperties consoleProperties) throws ExecutionException {
Class<SMTestRunnerConnectionUtil> klass = SMTestRunnerConnectionUtil.class;
ConsoleView consoleView = null;
try {
Method createAndAttachConsole = klass.getMethod("createAndAttachConsole", String.class, ProcessHandler.class, TestConsoleProperties.class);
try {
consoleView = (ConsoleView) createAndAttachConsole.invoke(null, testFrameworkName, processHandler, consoleProperties);
} catch (IllegalAccessException | InvocationTargetException e) {
LOGGER.error(e);
}
} catch (NoSuchMethodException noSuchCreateAndAttachConsole3Method) {
try {
Method createAndAttachConsole = klass.getMethod("createAndAttachConsole", String.class, ProcessHandler.class, TestConsoleProperties.class, ExecutionEnvironment.class);
try {
consoleView = (ConsoleView) createAndAttachConsole.invoke(null, testFrameworkName, processHandler, consoleProperties, getEnvironment());
} catch (IllegalAccessException | InvocationTargetException e) {
LOGGER.error(e);
}
} catch (NoSuchMethodException noSuchCreateAndAttachConsole4Method) {
noSuchCreateAndAttachConsole4Method.printStackTrace();
}
}
return consoleView;
}
use of com.intellij.execution.ui.ConsoleView in project intellij-community by JetBrains.
the class PythonTestCommandLineStateBase method execute.
@Override
public ExecutionResult execute(Executor executor, PythonProcessStarter processStarter, CommandLinePatcher... patchers) throws ExecutionException {
final ProcessHandler processHandler = startProcess(processStarter, patchers);
final ConsoleView console = createAndAttachConsole(myConfiguration.getProject(), processHandler, executor);
DefaultExecutionResult executionResult = new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));
PyRerunFailedTestsAction rerunFailedTestsAction = new PyRerunFailedTestsAction(console);
if (console instanceof SMTRunnerConsoleView) {
rerunFailedTestsAction.init(((BaseTestsOutputConsoleView) console).getProperties());
rerunFailedTestsAction.setModelProvider(() -> ((SMTRunnerConsoleView) console).getResultsViewer());
}
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
return executionResult;
}
use of com.intellij.execution.ui.ConsoleView in project intellij-community by JetBrains.
the class PythonCommandLineState method execute.
public ExecutionResult execute(Executor executor, PythonProcessStarter processStarter, CommandLinePatcher... patchers) throws ExecutionException {
final ProcessHandler processHandler = startProcess(processStarter, patchers);
final ConsoleView console = createAndAttachConsole(myConfig.getProject(), processHandler, executor);
return new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));
}
use of com.intellij.execution.ui.ConsoleView in project intellij-community by JetBrains.
the class RunContentExecutor method run.
public void run() {
FileDocumentManager.getInstance().saveAllDocuments();
// Use user-provided console if exist. Create new otherwise
ConsoleView view = (myUserProvidedConsole != null ? myUserProvidedConsole : createConsole());
view.attachToProcess(myProcess);
if (myAfterCompletion != null) {
myProcess.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
ApplicationManager.getApplication().invokeLater(myAfterCompletion);
}
});
}
myProcess.startNotify();
}
Aggregations