// See also http://jira.qos.ch/browse/LOGBACK-338 @Test(timeout = 4000L) public void reconfigurationIsNotPossibleInTheAbsenceOfATopFile() throws IOException, JoranException, InterruptedException { String configurationStr = "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><include resource=\"asResource/inner1.xml\"/></configuration>"; configure(new ByteArrayInputStream(configurationStr.getBytes("UTF-8"))); ConfigurationWatchList configurationWatchList = ConfigurationWatchListUtil.getConfigurationWatchList(loggerContext); assertNull(configurationWatchList); // assertNull(configurationWatchList.getMainURL()); statusChecker.containsMatch(Status.WARN, "Due to missing top level"); StatusPrinter.print(loggerContext); ReconfigureOnChangeTask roct = getRegisteredReconfigureTask(); assertNull(roct); assertEquals(0, loggerContext.getScheduledFutures().size()); }
private void checkThatTaskCanBeStopped() { ScheduledFuture<?> future = loggerContext.getScheduledFutures().get(0); loggerContext.stop(); assertTrue(future.isCancelled()); }