use of org.infinispan.test.CherryPickClassLoader 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();
}
}
Aggregations