Fixed base test info
This commit is contained in:
parent
6e665be6b6
commit
3223e34619
|
@ -70,45 +70,11 @@ abstract class BaseTest {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val LOOPBACK = "loopback"
|
const val LOOPBACK = "loopback"
|
||||||
|
|
||||||
init {
|
|
||||||
println("---- " + javaClass.simpleName)
|
|
||||||
|
|
||||||
// assume SLF4J is bound to logback in the current environment
|
|
||||||
val rootLogger = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME) as Logger
|
|
||||||
val context = rootLogger.loggerContext
|
|
||||||
val jc = JoranConfigurator()
|
|
||||||
jc.context = context
|
|
||||||
context.reset() // override default configuration
|
|
||||||
|
|
||||||
// rootLogger.setLevel(Level.OFF)
|
|
||||||
|
|
||||||
// rootLogger.level = Level.INFO
|
|
||||||
rootLogger.level = Level.TRACE
|
|
||||||
// rootLogger.level = Level.DEBUG
|
|
||||||
// rootLogger.level = Level.ALL
|
|
||||||
|
|
||||||
|
|
||||||
// we only want error messages
|
|
||||||
val kryoLogger = LoggerFactory.getLogger("com.esotericsoftware") as Logger
|
|
||||||
kryoLogger.level = Level.ERROR
|
|
||||||
|
|
||||||
|
|
||||||
val encoder = PatternLayoutEncoder()
|
|
||||||
encoder.context = context
|
|
||||||
encoder.pattern = "%date{HH:mm:ss.SSS} %-5level [%logger{35}] %msg%n"
|
|
||||||
encoder.start()
|
|
||||||
val consoleAppender = ConsoleAppender<ILoggingEvent>()
|
|
||||||
consoleAppender.context = context
|
|
||||||
consoleAppender.encoder = encoder
|
|
||||||
consoleAppender.start()
|
|
||||||
rootLogger.addAppender(consoleAppender)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun clientConfig(): Configuration {
|
fun clientConfig(): Configuration {
|
||||||
val configuration = Configuration()
|
val configuration = Configuration()
|
||||||
configuration.subscriptionPort = 2000
|
configuration.subscriptionPort = 2000
|
||||||
configuration.publicationPort = 2001
|
configuration.publicationPort = 2001
|
||||||
|
configuration.enableIpcForLoopback = false
|
||||||
|
|
||||||
return configuration
|
return configuration
|
||||||
}
|
}
|
||||||
|
@ -122,6 +88,7 @@ abstract class BaseTest {
|
||||||
|
|
||||||
configuration.maxClientCount = 5
|
configuration.maxClientCount = 5
|
||||||
configuration.maxConnectionsPerIpAddress = 5
|
configuration.maxConnectionsPerIpAddress = 5
|
||||||
|
configuration.enableIpcForLoopback = false
|
||||||
|
|
||||||
return configuration
|
return configuration
|
||||||
}
|
}
|
||||||
|
@ -161,6 +128,41 @@ abstract class BaseTest {
|
||||||
@Volatile
|
@Volatile
|
||||||
private var isStopping = false
|
private var isStopping = false
|
||||||
|
|
||||||
|
init {
|
||||||
|
println("---- " + this.javaClass.simpleName)
|
||||||
|
|
||||||
|
// assume SLF4J is bound to logback in the current environment
|
||||||
|
val rootLogger = LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME) as Logger
|
||||||
|
val context = rootLogger.loggerContext
|
||||||
|
val jc = JoranConfigurator()
|
||||||
|
jc.context = context
|
||||||
|
context.reset() // override default configuration
|
||||||
|
|
||||||
|
// rootLogger.setLevel(Level.OFF)
|
||||||
|
|
||||||
|
// rootLogger.level = Level.INFO
|
||||||
|
rootLogger.level = Level.TRACE
|
||||||
|
// rootLogger.level = Level.DEBUG
|
||||||
|
// rootLogger.level = Level.ALL
|
||||||
|
|
||||||
|
|
||||||
|
// we only want error messages
|
||||||
|
val kryoLogger = LoggerFactory.getLogger("com.esotericsoftware") as Logger
|
||||||
|
kryoLogger.level = Level.ERROR
|
||||||
|
|
||||||
|
|
||||||
|
val encoder = PatternLayoutEncoder()
|
||||||
|
encoder.context = context
|
||||||
|
encoder.pattern = "%date{HH:mm:ss.SSS} %-5level [%logger{35}] %msg%n"
|
||||||
|
encoder.start()
|
||||||
|
val consoleAppender = ConsoleAppender<ILoggingEvent>()
|
||||||
|
consoleAppender.context = context
|
||||||
|
consoleAppender.encoder = encoder
|
||||||
|
consoleAppender.start()
|
||||||
|
rootLogger.addAppender(consoleAppender)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun addEndPoint(endPointConnection: EndPoint<*>) {
|
fun addEndPoint(endPointConnection: EndPoint<*>) {
|
||||||
endPointConnections.add(endPointConnection)
|
endPointConnections.add(endPointConnection)
|
||||||
synchronized(lock) { latch = CountDownLatch(endPointConnections.size + 1) }
|
synchronized(lock) { latch = CountDownLatch(endPointConnections.size + 1) }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user