Tweaked logs

This commit is contained in:
nathan 2020-09-03 09:52:57 +02:00
parent f35f57bd87
commit 8a8dbda3f5

View File

@ -25,9 +25,7 @@ import dorkbox.network.connection.Connection
import dorkbox.network.rmi.RemoteObject import dorkbox.network.rmi.RemoteObject
import dorkboxTest.network.BaseTest import dorkboxTest.network.BaseTest
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Assert import org.junit.Assert
import org.junit.Before
import org.junit.Test import org.junit.Test
import org.slf4j.LoggerFactory import org.slf4j.LoggerFactory
import java.util.concurrent.atomic.AtomicLong import java.util.concurrent.atomic.AtomicLong
@ -39,8 +37,7 @@ class RmiDelayedInvocationSpamTest : BaseTest() {
var async = true var async = true
@Before private fun setupLogBefore() {
fun setupLogBefore() {
// assume SLF4J is bound to logback in the current environment // assume SLF4J is bound to logback in the current environment
val rootLogger = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME) as Logger val rootLogger = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME) as Logger
val context = rootLogger.loggerContext val context = rootLogger.loggerContext
@ -52,8 +49,7 @@ class RmiDelayedInvocationSpamTest : BaseTest() {
rootLogger.level = Level.DEBUG rootLogger.level = Level.DEBUG
} }
@After private fun setupLogAfter() {
fun setupLogAfter() {
// assume SLF4J is bound to logback in the current environment // assume SLF4J is bound to logback in the current environment
val rootLogger = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME) as Logger val rootLogger = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME) as Logger
val context = rootLogger.loggerContext val context = rootLogger.loggerContext
@ -78,10 +74,12 @@ class RmiDelayedInvocationSpamTest : BaseTest() {
@Test @Test
fun rmiNetworkAync() { fun rmiNetworkAync() {
runBlocking { runBlocking {
setupLogBefore()
async = true async = true
rmi { configuration -> rmi { configuration ->
configuration.enableIpcForLoopback = false configuration.enableIpcForLoopback = false
} }
setupLogAfter()
} }
} }
@ -96,8 +94,10 @@ class RmiDelayedInvocationSpamTest : BaseTest() {
@Test @Test
fun rmiIpcAsync() { fun rmiIpcAsync() {
runBlocking { runBlocking {
setupLogBefore()
async = true async = true
rmi() rmi()
setupLogAfter()
} }
} }