Tibor17 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_r381938939
########## File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java ########## @@ -0,0 +1,123 @@ +package org.apache.maven.plugin.surefire.extensions; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.surefire.extensions.CloseableDaemonThread; +import org.apache.maven.surefire.extensions.CommandReader; +import org.apache.maven.surefire.extensions.EventHandler; +import org.apache.maven.surefire.extensions.ForkChannel; +import org.apache.maven.surefire.extensions.util.CountdownCloseable; +import org.apache.maven.surefire.extensions.util.LineConsumerThread; +import org.apache.maven.surefire.extensions.util.StreamFeeder; + +import javax.annotation.Nonnull; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketOption; +import java.nio.channels.Channel; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.nio.channels.WritableByteChannel; + +import static java.net.StandardSocketOptions.SO_KEEPALIVE; +import static java.net.StandardSocketOptions.SO_REUSEADDR; +import static java.net.StandardSocketOptions.TCP_NODELAY; +import static java.nio.channels.ServerSocketChannel.open; + +/** + * + */ +final class SurefireForkChannel extends ForkChannel Review comment: My plan was to mark this class as a default impl for Surefire. Therefore I did not specify the manner in the name of the class how the processes communicate. We developed extensions api for the purpose of adding more like `TCPSurefireForkChannel` and any other e.g. Remote Channel similar to the solution in the PR https://github.com/apache/maven-surefire/pull/74 ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services