@Test public void testLoggerContextsReturnsAsyncLoggerContext() { final AsyncLoggerContextSelector selector = new AsyncLoggerContextSelector(); selector.getContext(FQCN, null, false); final List<LoggerContext> list = selector.getLoggerContexts(); assertEquals(1, list.size()); assertTrue(list.get(0) instanceof AsyncLoggerContext); }
@Test public void testContextReturnsAsyncLoggerContext() { final AsyncLoggerContextSelector selector = new AsyncLoggerContextSelector(); final LoggerContext context = selector.getContext(FQCN, null, false); assertTrue(context instanceof AsyncLoggerContext); }
@Test public void testLoggerContextsListInitiallyEmpty() { final AsyncLoggerContextSelector selector = new AsyncLoggerContextSelector(); assertTrue(selector.getLoggerContexts().isEmpty()); } }
protected static boolean includeLocation(final String includeLocationConfigValue) { if (includeLocationConfigValue == null) { final boolean sync = !AsyncLoggerContextSelector.isSelected(); return sync; } return Boolean.parseBoolean(includeLocationConfigValue); }
@Test public void testContext2ReturnsAsyncLoggerContext() { final AsyncLoggerContextSelector selector = new AsyncLoggerContextSelector(); final LoggerContext context = selector.getContext(FQCN, null, false, null); assertTrue(context instanceof AsyncLoggerContext); }
@Test public void testContextNameIsAsyncLoggerContextWithClassHashCode() { final AsyncLoggerContextSelector selector = new AsyncLoggerContextSelector(); final LoggerContext context = selector.getContext(FQCN, null, false); final int hash = getClass().getClassLoader().hashCode(); final String expectedContextName = "AsyncContext@" + Integer.toHexString(hash); assertEquals(expectedContextName, context.getName()); }