ctx = (LoggerContext) LogManager.getContext(false);
}
@Test
public void testReconfiguration() throws Exception {
final Configuration cfg = ctx.getConfiguration();
assertNotNull("No configuration", cfg);
assertTrue("Not set to default configuration", cfg instanceof DefaultConfiguration);
final File file = new File(CONFIG);
LoggerContext loggerContext = (LoggerContext) LogManager.getContext(null, false, file.toURI());
assertNotNull("No Logger Context", loggerContext);
final Configuration newConfig = loggerContext.getConfiguration();
assertTrue("Configuration not reset", cfg != newConfig);
assertTrue("Reconfiguration failed", newConfig instanceof XmlConfiguration);
ctx = (LoggerContext) LogManager.getContext(false);
final Configuration sameConfig = ctx.getConfiguration();
assertTrue("Configuration should not have been reset", newConfig == sameConfig);
}