Fixed logging for tests

This commit is contained in:
nathan 2020-09-03 15:01:42 +02:00
parent 3223e34619
commit 818687c0d8
3 changed files with 8 additions and 10 deletions

View File

@ -71,14 +71,14 @@ class MultipleServerTest : BaseTest() {
val server: Server<Connection> = Server(configuration) val server: Server<Connection> = Server(configuration)
addEndPoint(server) addEndPoint(server)
server.onMessage<String>{ _, message -> server.onMessage<String>{ connection, message ->
if (message != "client_$count") { if (message != "client_$count") {
Assert.fail() Assert.fail()
} }
didReceive[count].set(true) didReceive[count].set(true)
if (received.incrementAndGet() == total) { if (received.incrementAndGet() == total) {
println("Done, stopping endpoints") connection.logger.error("Done, stopping endpoints")
stopEndPoints() stopEndPoints()
} }
} }

View File

@ -69,7 +69,7 @@ class PingPongTest : BaseTest() {
server.onConnect { connection -> server.onConnect { connection ->
server.forEachConnection { 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.onConnect { connection ->
client.forEachConnection { connection -> client.forEachConnection { connection ->
println("client connection: $connection") connection.logger.error("client connection: $connection")
} }
fail = null fail = null
@ -105,8 +105,8 @@ class PingPongTest : BaseTest() {
if (counter.getAndIncrement() <= tries) { if (counter.getAndIncrement() <= tries) {
connection.send(data) connection.send(data)
} else { } else {
System.err.println("done.") connection.logger.error("done.")
System.err.println("Ran $tries times") connection.logger.error("Ran $tries times")
stopEndPoints() stopEndPoints()
} }
} }

View File

@ -73,13 +73,12 @@ class RmiDelayedInvocationSpamTest : BaseTest() {
@Test @Test
fun rmiNetworkAync() { fun rmiNetworkAync() {
setupLogBefore()
runBlocking { runBlocking {
setupLogBefore()
async = true async = true
rmi { configuration -> rmi { configuration ->
configuration.enableIpcForLoopback = false configuration.enableIpcForLoopback = false
} }
setupLogAfter()
} }
} }
@ -93,11 +92,10 @@ class RmiDelayedInvocationSpamTest : BaseTest() {
@Test @Test
fun rmiIpcAsync() { fun rmiIpcAsync() {
setupLogBefore()
runBlocking { runBlocking {
setupLogBefore()
async = true async = true
rmi() rmi()
setupLogAfter()
} }
} }