void (TestConsoleProperties consoleProperties, SMTestRunnerResultsForm resultsViewer, ProcessHandler processHandler, String testFrameworkName, @Nullable SMTestLocator locator, boolean idBasedTestTree, @Nullable TestProxyPrinterProvider printerProvider) { // build messages consumer final OutputToGeneralTestEventsConverter outputConsumer; if (consoleProperties instanceof SMCustomMessagesParsing) { outputConsumer = ((SMCustomMessagesParsing)consoleProperties).createTestEventsConverter(testFrameworkName, consoleProperties); } else { outputConsumer = new OutputToGeneralTestEventsConverter(testFrameworkName, consoleProperties); } // UI actions SMTRunnerUIActionsHandler uiActionsHandler = new SMTRunnerUIActionsHandler(consoleProperties); // subscribes test runner's actions on results viewer events resultsViewer.addEventsListener(uiActionsHandler); outputConsumer.setTestingStartedHandler(() -> { // events processor GeneralTestEventsProcessor eventsProcessor; if (idBasedTestTree) { eventsProcessor = new GeneralIdBasedToSMTRunnerEventsConvertor(consoleProperties.getProject(), resultsViewer.getTestsRootNode(), testFrameworkName); } else { eventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), resultsViewer.getTestsRootNode(), testFrameworkName); } if (locator != null) { eventsProcessor.setLocator(locator); } if (printerProvider != null) { eventsProcessor.setPrinterProvider(printerProvider); } // subscribes result viewer on event processor eventsProcessor.addEventsListener(resultsViewer); // subscribes event processor on output consumer events outputConsumer.setProcessor(eventsProcessor); }); outputConsumer.setupProcessor(); processHandler.addProcessListener(new ProcessAdapter() { @Override public void startNotified(@NotNull ProcessEvent event) { outputConsumer.startTesting(); } @Override public void processTerminated(@NotNull final ProcessEvent event) { outputConsumer.flushBufferOnProcessTermination(event.getExitCode()); outputConsumer.finishTesting(); Disposer.dispose(outputConsumer); } @Override public void onTextAvailable(@NotNull final ProcessEvent event, @NotNull final Key outputType) { outputConsumer.process(event.getText(), outputType); } }); }