You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2020/10/09 15:03:46 UTC

[maven-surefire] 01/01: [GH] do not use std/out and std/err in E2ETest.java

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 756a134f6e2411efba12a36d1f9bc8e21528e9ac
Author: tibordigana <ti...@apache.org>
AuthorDate: Fri Oct 9 12:20:00 2020 +0200

    [GH] do not use std/out and std/err in E2ETest.java
---
 .../apache/maven/plugin/surefire/extensions/E2ETest.java | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java
index c420644..f3becd7 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java
@@ -24,7 +24,6 @@ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
 import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger;
 import org.apache.maven.surefire.api.booter.MasterProcessChannelEncoder;
 import org.apache.maven.surefire.api.event.Event;
-import org.apache.maven.surefire.api.report.ConsoleOutputCapture;
 import org.apache.maven.surefire.api.report.ConsoleOutputReceiver;
 import org.apache.maven.surefire.booter.spi.SurefireMasterProcessChannelProcessorFactory;
 import org.apache.maven.surefire.extensions.EventHandler;
@@ -37,7 +36,6 @@ import org.junit.rules.ExpectedException;
 import javax.annotation.Nonnull;
 import java.io.Closeable;
 import java.io.File;
-import java.io.PrintStream;
 import java.net.URI;
 import java.nio.ByteBuffer;
 import java.nio.channels.ReadableByteChannel;
@@ -100,23 +98,23 @@ public class E2ETest
                     }
                 };
 
-                PrintStream out = System.out;
-                PrintStream err = System.err;
+                //PrintStream out = System.out;
+                //PrintStream err = System.err;
 
-                ConsoleOutputCapture.startCapture( target );
+                //ConsoleOutputCapture.startCapture( target );
 
                 try
                 {
                     long t1 = System.currentTimeMillis();
                     for ( int i = 0; i < totalCalls; i++ )
                     {
-                        System.out.println( LONG_STRING );
-                        //encoder.stdOut( LONG_STRING, true );
+                        //System.out.println( LONG_STRING );
+                        encoder.stdOut( LONG_STRING, true );
                     }
                     long t2 = System.currentTimeMillis();
                     long spent = t2 - t1;
-                    System.setOut( out );
-                    System.setErr( err );
+                    //System.setOut( out );
+                    //System.setErr( err );
                     System.out.println( spent + "ms on write" );
                     awaitHandlerFinished.countDown();
                 }