From 818687c0d8d59e16cbb5f2dc4507b06ba4f56238 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 3 Sep 2020 15:01:42 +0200 Subject: [PATCH] Fixed logging for tests --- test/dorkboxTest/network/MultipleServerTest.kt | 4 ++-- test/dorkboxTest/network/PingPongTest.kt | 8 ++++---- .../network/rmi/RmiDelayedInvocationSpamTest.kt | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/test/dorkboxTest/network/MultipleServerTest.kt b/test/dorkboxTest/network/MultipleServerTest.kt index 9e19ccd2..d57f8c4e 100644 --- a/test/dorkboxTest/network/MultipleServerTest.kt +++ b/test/dorkboxTest/network/MultipleServerTest.kt @@ -71,14 +71,14 @@ class MultipleServerTest : BaseTest() { val server: Server = Server(configuration) addEndPoint(server) - server.onMessage{ _, message -> + server.onMessage{ connection, message -> if (message != "client_$count") { Assert.fail() } didReceive[count].set(true) if (received.incrementAndGet() == total) { - println("Done, stopping endpoints") + connection.logger.error("Done, stopping endpoints") stopEndPoints() } } diff --git a/test/dorkboxTest/network/PingPongTest.kt b/test/dorkboxTest/network/PingPongTest.kt index 60baaa80..1738a2dd 100644 --- a/test/dorkboxTest/network/PingPongTest.kt +++ b/test/dorkboxTest/network/PingPongTest.kt @@ -69,7 +69,7 @@ class PingPongTest : BaseTest() { server.onConnect { connection -> server.forEachConnection { connection -> - println("server connection: $connection") + connection.logger.error("server connection: $connection") } } @@ -88,7 +88,7 @@ class PingPongTest : BaseTest() { client.onConnect { connection -> client.forEachConnection { connection -> - println("client connection: $connection") + connection.logger.error("client connection: $connection") } fail = null @@ -105,8 +105,8 @@ class PingPongTest : BaseTest() { if (counter.getAndIncrement() <= tries) { connection.send(data) } else { - System.err.println("done.") - System.err.println("Ran $tries times") + connection.logger.error("done.") + connection.logger.error("Ran $tries times") stopEndPoints() } } diff --git a/test/dorkboxTest/network/rmi/RmiDelayedInvocationSpamTest.kt b/test/dorkboxTest/network/rmi/RmiDelayedInvocationSpamTest.kt index 901028c3..2abb75e9 100644 --- a/test/dorkboxTest/network/rmi/RmiDelayedInvocationSpamTest.kt +++ b/test/dorkboxTest/network/rmi/RmiDelayedInvocationSpamTest.kt @@ -73,13 +73,12 @@ class RmiDelayedInvocationSpamTest : BaseTest() { @Test fun rmiNetworkAync() { + setupLogBefore() runBlocking { - setupLogBefore() async = true rmi { configuration -> configuration.enableIpcForLoopback = false } - setupLogAfter() } } @@ -93,11 +92,10 @@ class RmiDelayedInvocationSpamTest : BaseTest() { @Test fun rmiIpcAsync() { + setupLogBefore() runBlocking { - setupLogBefore() async = true rmi() - setupLogAfter() } }