use of org.neo4j.logging.async.AsyncLogProvider in project neo4j by neo4j.
the class AsyncLoggingTest method shouldLogWhenLoggingThreadStarts.
@Test
public void shouldLogWhenLoggingThreadStarts() throws Exception {
// given
AssertableLogProvider logs = new AssertableLogProvider();
AsyncLogging logging = new AsyncLogging(logs.getLog("meta"));
// when
new AsyncLogProvider(logging.eventSender(), logs).getLog("test").info("hello");
// then
logs.assertNoLoggingOccurred();
// when
logging.start();
logging.stop();
// then
logs.assertExactly(inLog("test").info(endsWith("hello")));
}
use of org.neo4j.logging.async.AsyncLogProvider in project neo4j by neo4j.
the class AsyncLoggingTest method shouldLogMessages.
@Test
public void shouldLogMessages() throws Exception {
// given
AssertableLogProvider logs = new AssertableLogProvider();
AsyncLogging logging = new AsyncLogging(logs.getLog("meta"));
// when
logging.start();
try {
new AsyncLogProvider(logging.eventSender(), logs).getLog("test").info("hello");
} finally {
logging.stop();
}
// then
logs.assertExactly(inLog("test").info(endsWith("hello")));
}
Aggregations