From 06f9faccf58c2a95fc4b1a08007bacdeab9137af Mon Sep 17 00:00:00 2001 From: rusefi Date: Wed, 8 Jul 2020 16:30:31 -0400 Subject: [PATCH] proxy progress --- .../io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java | 3 +-- .../java/com/rusefi/io/TcpCommunicationIntegrationTest.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java b/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java index 2c371ed495..c1b95c466d 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/TcpIoStream.java @@ -56,9 +56,8 @@ public class TcpIoStream implements IoStream { @Override public void setInputListener(final DataListener listener) { - ByteReader reader = buffer -> input.read(buffer); - ByteReader.runReaderLoop(listener, reader, logger); + ByteReader.runReaderLoop(listener, input::read, logger); } @Override diff --git a/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java b/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java index ee0d0c4627..57adebe20c 100644 --- a/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java +++ b/java_console/ui/src/test/java/com/rusefi/io/TcpCommunicationIntegrationTest.java @@ -78,7 +78,7 @@ public class TcpCommunicationIntegrationTest { System.out.println("Failed"); } }); - assertTrue(connectionEstablishedCountDownLatch.await(30, TimeUnit.SECONDS)); + assertTrue("Connection established", connectionEstablishedCountDownLatch.await(30, TimeUnit.SECONDS)); assertEquals(0, server.unknownCommands.get()); @@ -112,7 +112,7 @@ public class TcpCommunicationIntegrationTest { CountDownLatch connectionEstablishedCountDownLatch = new CountDownLatch(1); LinkManager clientManager = new LinkManager(LOGGER); - clientManager.startAndConnect(Integer.toString(proxyPort), new ConnectionStateListener() { + clientManager.startAndConnect(LOCALHOST + ":" + proxyPort, new ConnectionStateListener() { @Override public void onConnectionEstablished() { connectionEstablishedCountDownLatch.countDown(); @@ -123,7 +123,7 @@ public class TcpCommunicationIntegrationTest { System.out.println("Failed"); } }); - assertTrue(connectionEstablishedCountDownLatch.await(30, TimeUnit.SECONDS)); + assertTrue("Connection established", connectionEstablishedCountDownLatch.await(30, TimeUnit.SECONDS)); clientManager.stop(); }