protractor: clear out '.' and 'F' characters emitted by default protractor reporter...
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 3 Nov 2016 09:25:09 +0000 (12:25 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 3 Nov 2016 09:25:09 +0000 (12:25 +0300)
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockGeneralTestEventsProcessorAdapter.java

index ae924ed9c4b28915957e2d5e2f87c83fe55109e3..9f494004ccf959c95eef998ba8ef3aae7d042940 100644 (file)
@@ -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);
index 7743340f43a53dc02e6d7d75b73580e8b8ed2a1a..ce33179abb37734a840c565b5eabb0a0cc450cae 100644 (file)
@@ -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<Pair<String, Key>> 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<Pair<String, Key>> getUncapturedOutputChunks() {
+    return myOutputChunks;
+  }
 }