@SuppressWarnings("unchecked") public static void configureLogging(Level level) { ch.qos.logback.classic.Logger valverlog = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Version.class); valverlog.setLevel(ERROR); ch.qos.logback.classic.Logger reflog = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Reflections.class); reflog.setLevel(ERROR); ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("ROOT"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); ConsoleAppender console = (ConsoleAppender) logger.getAppender("console"); logger.setLevel(level); console.stop(); PatternLayout pl = new PatternLayout(); pl.setPattern("%r %5p [%X{resource}] %m%n%nopex"); pl.setContext(lc); pl.start(); console.setLayout(pl); console.start(); }
@Test public void testValidation() { assertEquals( "6.0.0.Alpha1", Version.getVersionString() ); }