use of ch.qos.logback.classic.Logger in project nifi by apache.
the class TestFileSystemRepository method testMinimalArchiveCleanupIntervalHonoredAndLogged.
@Test
public void testMinimalArchiveCleanupIntervalHonoredAndLogged() throws Exception {
// We are going to construct our own repository using different properties, so
// we need to shutdown the existing one.
shutdown();
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
ListAppender<ILoggingEvent> testAppender = new ListAppender<>();
testAppender.setName("Test");
testAppender.start();
root.addAppender(testAppender);
final Map<String, String> addProps = new HashMap<>();
addProps.put(NiFiProperties.CONTENT_ARCHIVE_CLEANUP_FREQUENCY, "1 millis");
final NiFiProperties localProps = NiFiProperties.createBasicNiFiProperties(null, addProps);
repository = new FileSystemRepository(localProps);
repository.initialize(new StandardResourceClaimManager());
repository.purge();
boolean messageFound = false;
String message = "The value of nifi.content.repository.archive.cleanup.frequency property " + "is set to '1 millis' which is below the allowed minimum of 1 second (1000 milliseconds). " + "Minimum value of 1 sec will be used as scheduling interval for archive cleanup task.";
// keyword guards testAppender.list. Since we are accessing testAppender.list, we must do so in a thread-safe manner.
synchronized (testAppender) {
for (ILoggingEvent event : testAppender.list) {
String actualMessage = event.getFormattedMessage();
if (actualMessage.equals(message)) {
assertEquals(event.getLevel(), Level.WARN);
messageFound = true;
break;
}
}
}
assertTrue(messageFound);
}
use of ch.qos.logback.classic.Logger in project webofneeds by researchstudio-sat.
the class AllAcceptsTest method setLogLevel.
@BeforeClass
public static void setLogLevel() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);
}
use of ch.qos.logback.classic.Logger in project webofneeds by researchstudio-sat.
the class PendingProposesTest method setLogLevel.
@BeforeClass
public static void setLogLevel() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);
}
use of ch.qos.logback.classic.Logger in project webofneeds by researchstudio-sat.
the class PendingProposesToCancelTest method setLogLevel.
@BeforeClass
public static void setLogLevel() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);
}
use of ch.qos.logback.classic.Logger in project webofneeds by researchstudio-sat.
the class ProposalTest method setLogLevel.
@BeforeClass
public static void setLogLevel() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);
}
Aggregations