From dcf7a817438e5f9cfdca8a126c65e9378b99b619 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Thu, 3 Nov 2016 12:25:09 +0300 Subject: [PATCH] protractor: clear out '.' and 'F' characters emitted by default protractor reporter for single capabilities --- .../sm/runner/OutputToGeneralTestEventsConverter.java | 6 +++++- .../runner/MockGeneralTestEventsProcessorAdapter.java | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java index ae924ed9c4b2..9f494004ccf9 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java @@ -52,9 +52,13 @@ public class OutputToGeneralTestEventsConverter implements ProcessOutputConsumer private boolean myPendingLineBreakFlag; public OutputToGeneralTestEventsConverter(@NotNull String testFrameworkName, @NotNull TestConsoleProperties consoleProperties) { + this(testFrameworkName, consoleProperties.isEditable()); + } + + public OutputToGeneralTestEventsConverter(@NotNull String testFrameworkName, boolean stdinEnabled) { myTestFrameworkName = testFrameworkName; myServiceMessageVisitor = new MyServiceMessageVisitor(); - mySplitter = new OutputLineSplitter(consoleProperties.isEditable()) { + mySplitter = new OutputLineSplitter(stdinEnabled) { @Override protected void onLineAvailable(@NotNull String text, @NotNull Key outputType, boolean tcLikeFakeOutput) { processConsistentText(text, outputType, tcLikeFakeOutput); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockGeneralTestEventsProcessorAdapter.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockGeneralTestEventsProcessorAdapter.java index 7743340f43a5..ce33179abb37 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockGeneralTestEventsProcessorAdapter.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockGeneralTestEventsProcessorAdapter.java @@ -18,14 +18,19 @@ package com.intellij.execution.testframework.sm.runner; import com.intellij.execution.testframework.sm.runner.events.*; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; +import com.intellij.openapi.util.Pair; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; +import java.util.List; + /** * @author Roman.Chernyatchik */ public class MockGeneralTestEventsProcessorAdapter extends GeneralTestEventsProcessor { private final StringBuilder myOutputBuffer = new StringBuilder(); + private final List> myOutputChunks = new ArrayList<>(); public MockGeneralTestEventsProcessorAdapter(Project project, String testFrameworkName) { super(project, testFrameworkName); @@ -70,6 +75,7 @@ public class MockGeneralTestEventsProcessorAdapter extends GeneralTestEventsProc @Override public void onUncapturedOutput(@NotNull String text, Key outputType) { myOutputBuffer.append("[").append(outputType.toString()).append("]").append(text); + myOutputChunks.add(Pair.create(text, outputType)); } @Override @@ -121,4 +127,9 @@ public class MockGeneralTestEventsProcessorAdapter extends GeneralTestEventsProc public String getOutput() { return myOutputBuffer.toString(); } + + @NotNull + public List> getUncapturedOutputChunks() { + return myOutputChunks; + } }