use of jodd.log.impl.NOPLoggerFactory in project jodd by oblac.
the class LoggerFactoryTest method testNopLogger.
@Test
public void testNopLogger() {
LoggerFactory.setLoggerFactory(new NOPLoggerFactory());
Logger log = LoggerFactory.getLogger("foo");
assertEquals("*", log.getName());
PrintStream out = System.out;
ByteArrayOutputStream sos = new ByteArrayOutputStream();
System.setOut(new PrintStream(sos));
log.debug("nothing");
log.error("nothing");
assertEquals("", sos.toString());
System.setOut(out);
}
use of jodd.log.impl.NOPLoggerFactory in project jodd by oblac.
the class DbBaseTest method init.
protected void init() {
LoggerFactory.setLoggerFactory(new NOPLoggerFactory() {
@Override
public Logger getLogger(String name) {
return new NOPLogger("") {
@Override
public boolean isWarnEnabled() {
return true;
}
@Override
public void warn(String message) {
throw new UncheckedException("NO WARNINGS ALLOWED: " + message);
}
@Override
public void warn(String message, Throwable throwable) {
throw new UncheckedException("NO WARNINGS ALLOWED: " + message);
}
};
}
});
DbOomManager.resetAll();
dboom = DbOomManager.getInstance();
connectionPool = new CoreConnectionPool();
}
Aggregations