maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [maven-surefire] eolivelli commented on a change in pull request #240: [SUREFIRE-1658] TCP/IP Channel for forked Surefire JVM. Extensions API and SPI. Polymorphism for remote and local process communication.
Date Wed, 12 Feb 2020 13:49:57 GMT
eolivelli commented on a change in pull request #240: [SUREFIRE-1658] TCP/IP Channel for forked
Surefire JVM. Extensions API and SPI. Polymorphism for remote and local process communication.
URL: https://github.com/apache/maven-surefire/pull/240#discussion_r378260883
 
 

 ##########
 File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
 ##########
 @@ -602,38 +613,44 @@ private RunResult fork( Object testSet, PropertiesWrapper providerProperties,
Fo
         }
 
         ThreadedStreamConsumer eventConsumer = new ThreadedStreamConsumer( forkClient );
-        CloseableCloser closer = new CloseableCloser( forkNumber, eventConsumer, requireNonNull(
commandInputStream ) );
+        CloseableCloser closer = new CloseableCloser( forkNumber, eventConsumer, commandReader
);
 
         log.debug( "Forking command line: " + cli );
 
         Integer result = null;
         RunResult runResult = null;
         SurefireBooterForkException booterForkException = null;
-        StreamFeeder in = null;
-        LineConsumerThread out = null;
-        LineConsumerThread err = null;
+        CloseableDaemonThread in = null;
+        CloseableDaemonThread out = null;
+        CloseableDaemonThread err = null;
         DefaultReporterFactory reporter = forkClient.getDefaultReporterFactory();
         currentForkClients.add( forkClient );
-        CountdownCloseable countdownCloseable = new CountdownCloseable( eventConsumer, 2
);
+        CountdownCloseable countdownCloseable =
+            new CountdownCloseable( eventConsumer, 1 + ( forkChannel.useStdOut() ? 1 : 0
) );
         try ( CommandlineExecutor exec = new CommandlineExecutor( cli, countdownCloseable
) )
         {
-            // default impl of the extension - solves everything including the encoder/decoder,
Process starter,
-            // adaptation of the streams to pipes and sockets
-            // non-default impl may use another classes and not the LineConsumerThread, StreamFeeder
- freedom
-            // BEGIN: beginning of the call of the extension
             CommandlineStreams streams = exec.execute();
             closer.addCloseable( streams );
-            in = new StreamFeeder( "std-in-fork-" + forkNumber, streams.getStdInChannel(),
commandInputStream );
+
+            forkChannel.openChannel();
+
+            in = forkChannel.useStdIn()
+                ? forkChannel.bindCommandReader( commandReader, streams.getStdInChannel()
)
 
 Review comment:
   @Tibor17 
   I would go with only one method, that takes all of the parameters, maybe some implementation
won't use all of them but is more object oriented

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message