use of io.vertx.test.netty.TestLoggerFactory in project vert.x by eclipse.
the class HttpTest method testLogging.
private TestLoggerFactory testLogging() throws Exception {
InternalLoggerFactory prev = InternalLoggerFactory.getDefaultFactory();
TestLoggerFactory factory = new TestLoggerFactory();
InternalLoggerFactory.setDefaultFactory(factory);
try {
server.requestHandler(req -> {
req.response().end();
});
startServer();
client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath", resp -> {
testComplete();
});
await();
} finally {
InternalLoggerFactory.setDefaultFactory(prev);
}
return factory;
}
use of io.vertx.test.netty.TestLoggerFactory in project vert.x by eclipse.
the class HttpTest method testNoLogging.
@Test
public void testNoLogging() throws Exception {
TestLoggerFactory factory = testLogging();
assertFalse(factory.hasName("io.netty.handler.codec.http2.Http2FrameLogger"));
}
use of io.vertx.test.netty.TestLoggerFactory in project vert.x by eclipse.
the class HttpTest method testClientLogging.
@Test
public void testClientLogging() throws Exception {
client.close();
client = vertx.createHttpClient(createBaseClientOptions().setLogActivity(true));
TestLoggerFactory factory = testLogging();
if (this instanceof Http1xTest) {
assertTrue(factory.hasName("io.netty.handler.logging.LoggingHandler"));
} else {
assertTrue(factory.hasName("io.netty.handler.codec.http2.Http2FrameLogger"));
}
}
use of io.vertx.test.netty.TestLoggerFactory in project vert.x by eclipse.
the class NetTest method testServerLogging.
@Test
public void testServerLogging() throws Exception {
server.close();
server = vertx.createNetServer(new NetServerOptions().setLogActivity(true));
TestLoggerFactory factory = testLogging();
assertTrue(factory.hasName("io.netty.handler.logging.LoggingHandler"));
}
use of io.vertx.test.netty.TestLoggerFactory in project vert.x by eclipse.
the class DatagramTest method testListenLogging.
@Test
public void testListenLogging() throws Exception {
TestLoggerFactory factory = testLogging(new DatagramSocketOptions(), new DatagramSocketOptions().setLogActivity(true));
assertTrue(factory.hasName("io.netty.handler.logging.LoggingHandler"));
}
Aggregations