Logger jsrLogger = java.util.logging.Logger.getLogger("org.apache.uima");
while(jsrLogger.getLevel() == null) {
jsrLogger = jsrLogger.getParent();
}
Level defaultLogLevel = logLevels.get(jsrLogger.getLevel().toString());
// check message logging for root logger based on default log level
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.ALL), uimaLogger
.isLoggable(Level.ALL));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINEST), uimaLogger
.isLoggable(Level.FINEST));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINER), uimaLogger
.isLoggable(Level.FINER));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINE), uimaLogger
.isLoggable(Level.FINE));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.CONFIG), uimaLogger
.isLoggable(Level.CONFIG));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.INFO), uimaLogger
.isLoggable(Level.INFO));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.WARNING), uimaLogger
.isLoggable(Level.WARNING));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.SEVERE), uimaLogger
.isLoggable(Level.SEVERE));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.OFF), uimaLogger
.isLoggable(Level.OFF));
// check message logging for class logger based on default log level
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.ALL), classLogger
.isLoggable(Level.ALL));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINEST), classLogger
.isLoggable(Level.FINEST));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINER), classLogger
.isLoggable(Level.FINER));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.FINE), classLogger
.isLoggable(Level.FINE));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.CONFIG), classLogger
.isLoggable(Level.CONFIG));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.INFO), classLogger
.isLoggable(Level.INFO));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.WARNING), classLogger
.isLoggable(Level.WARNING));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.SEVERE), classLogger
.isLoggable(Level.SEVERE));
Assert.assertEquals(defaultLogLevel.isGreaterOrEqual(Level.OFF), classLogger
.isLoggable(Level.OFF));
// reset class logger level to OFF
// Logger.getLogger(this.getClass().getName()).setLevel(java.util.logging.Level.OFF);
classLogger.setLevel(Level.OFF);