use of org.infinispan.commons.test.skip.StringLogAppender in project infinispan by infinispan.
the class EpollAvailabilityTest method testEpollNotAvailable.
public void testEpollNotAvailable() throws Exception {
SkipTestNG.onlyOnOS(OS.LINUX);
Thread testThread = Thread.currentThread();
StringLogAppender logAppender = new StringLogAppender("org.infinispan.HOTROD", Level.TRACE, t -> t == testThread, PatternLayout.newBuilder().withPattern(LOG_FORMAT).build());
logAppender.install();
try {
CherryPickClassLoader classLoader = new CherryPickClassLoader(new String[] { EPOLL_AVAILABLE_CLASS }, null, new String[] { "io.netty.channel.epoll.Epoll" }, this.getClass().getClassLoader());
Class.forName(EPOLL_AVAILABLE_CLASS, true, classLoader);
String firstLine = logAppender.getLog(0);
assertTrue(firstLine, firstLine.contains("io.netty.channel.epoll.Epoll"));
} finally {
logAppender.uninstall();
}
}
use of org.infinispan.commons.test.skip.StringLogAppender in project infinispan by infinispan.
the class HotRodAccessLoggingTest method setup.
@Override
protected void setup() throws Exception {
testShortName = TestResourceTracker.getCurrentTestShortName();
logAppender = new StringLogAppender("org.infinispan.HOTROD_ACCESS_LOG", Level.TRACE, t -> t.getName().startsWith("non-blocking-thread-" + testShortName), PatternLayout.newBuilder().withPattern(LOG_FORMAT).build());
logAppender.install();
super.setup();
}
use of org.infinispan.commons.test.skip.StringLogAppender in project infinispan by infinispan.
the class RestAccessLoggingTest method setup.
@Override
protected void setup() throws Exception {
super.setup();
testShortName = TestResourceTracker.getCurrentTestShortName();
logAppender = new StringLogAppender("org.infinispan.REST_ACCESS_LOG", Level.TRACE, t -> t.getName().startsWith("non-blocking-thread-" + testShortName), PatternLayout.newBuilder().withPattern(LOG_FORMAT).build());
logAppender.install();
restServer = new RestServerHelper(cacheManager);
restServer.start(TestResourceTracker.getCurrentTestShortName());
RestClientConfigurationBuilder builder = new RestClientConfigurationBuilder();
builder.addServer().host(restServer.getHost()).port(restServer.getPort());
restClient = RestClient.forConfiguration(builder.create());
cacheClient = restClient.cache("default");
}
Aggregations