Add static block() method in ClientServerIntegrationTestsSupport to prevent forked, non-daemon JVM processes used in testing from prematurely terminating.

This commit is contained in:
John Blum
2021-09-09 11:05:04 -07:00
parent 9dcd1ed8ea
commit 2ff96e5c6f

View File

@@ -24,6 +24,7 @@ import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Optional;
import java.util.Scanner;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.TimeUnit;
@@ -115,6 +116,10 @@ public abstract class ClientServerIntegrationTestsSupport extends IntegrationTes
return Boolean.getBoolean(PROCESS_RUN_MANUAL_PROPERTY);
}
protected static void block() {
new Scanner(System.in).nextLine();
}
protected static @Nullable ProcessWrapper run(Class<?> type, String... arguments) throws IOException {
return run(createDirectory(asDirectoryName(type)), type, arguments);
}