void (@NotNull TestOutputConsole outputConsole, GeneralCommandLine commandLine, @NotNull ProcessHandler processHandler) { outputConsole.appendOutput(ProcessOutputTypes.SYSTEM, commandLine.getCommandLineString()); processHandler.addProcessListener(new ProcessAdapter() { @Override public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) { if (outputType == ProcessOutputTypes.STDOUT || outputType == ProcessOutputTypes.STDERR) { outputConsole.appendOutput(outputType, event.getText()); } } @Override public void processTerminated(@NotNull ProcessEvent event) { outputConsole.processTerminated(event.getExitCode()); } }); }