Replace use of deprecated Runtime.exe(String cmd)

This commit is contained in:
Alexej Timonin 2024-07-23 22:57:48 +02:00
parent ea2b4f817a
commit 58860a1580
1 changed files with 3 additions and 3 deletions

View File

@ -48,8 +48,8 @@ public class SSHTunnelNetworkReconnectTest extends NetworkReconnectTest {
@Override
protected void setUp() throws Exception {
startProcess("ssh -Nn -L60006:localhost:61616 localhost");
startProcess("ssh -Nn -L60007:localhost:61617 localhost");
startProcess("ssh", "-Nn", "-L60006:localhost:61616", "localhost");
startProcess("ssh", "-Nn", "-L60007:localhost:61617", "localhost");
super.setUp();
}
@ -61,7 +61,7 @@ public class SSHTunnelNetworkReconnectTest extends NetworkReconnectTest {
}
}
private void startProcess(String command) throws IOException {
private void startProcess(String... command) throws IOException {
final Process process = Runtime.getRuntime().exec(command);
processes.add(process);
new Thread("stdout: " + command) {