assertNotNull("No configuration", config);
assertEquals("Incorrect Configuration.", CONFIG_NAME, config.getName());
final Map<String, Appender> map = config.getAppenders();
assertNotNull("Appenders map should not be null.", map);
assertTrue("Appenders map should not be empty.", map.size() > 0);
Appender app = null;
for (final Map.Entry<String, Appender> entry: map.entrySet()) {
if (entry.getKey().equals("List2")) {
app = entry.getValue();
break;
}
}
assertNotNull("No ListAppender named List2", app);
final Layout<? extends Serializable> layout = app.getLayout();
assertNotNull("Appender List2 does not have a Layout", layout);
assertTrue("Appender List2 is not configured with a PatternLayout", layout instanceof PatternLayout);
final String pattern = ((PatternLayout) layout).getConversionPattern();
assertNotNull("No conversion pattern for List2 PatternLayout", pattern);
assertFalse("Environment variable was not substituted", pattern.startsWith("${env:PATH}"));