@@ -47,19 +47,11 @@ public class ConfigurationAssemblerTest {
4747
4848 @ Test
4949 public void testBuildConfiguration () throws Exception {
50- try {
51- System .setProperty (
52- Log4jPropertyKey .CONTEXT_SELECTOR_CLASS_NAME .getSystemKey (),
53- "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector" );
54- final ConfigurationBuilder <BuiltConfiguration > builder =
55- ConfigurationBuilderFactory .newConfigurationBuilder ();
56- CustomConfigurationFactory .addTestFixtures ("config name" , builder );
57- final Configuration configuration = builder .build ();
58- try (final LoggerContext ctx = Configurator .initialize (configuration )) {
59- validate (configuration );
60- }
61- } finally {
62- System .getProperties ().remove (Log4jPropertyKey .CONTEXT_SELECTOR_CLASS_NAME .getSystemKey ());
50+ final ConfigurationBuilder <BuiltConfiguration > builder = ConfigurationBuilderFactory .newConfigurationBuilder ();
51+ CustomConfigurationFactory .addTestFixtures ("config name" , builder );
52+ final Configuration configuration = builder .build ();
53+ try (final LoggerContext ctx = Configurator .initialize (configuration )) {
54+ validate (configuration );
6355 }
6456 }
6557
@@ -69,13 +61,9 @@ public void testCustomConfigurationFactory() throws Exception {
6961 System .setProperty (
7062 Log4jPropertyKey .CONFIG_CONFIGURATION_FACTORY_CLASS_NAME .getSystemKey (),
7163 "org.apache.logging.log4j.script.config.builder.CustomConfigurationFactory" );
72- System .setProperty (
73- Log4jPropertyKey .CONTEXT_SELECTOR_CLASS_NAME .getSystemKey (),
74- "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector" );
7564 final Configuration config = ((LoggerContext ) LogManager .getContext (false )).getConfiguration ();
7665 validate (config );
7766 } finally {
78- System .getProperties ().remove (Log4jPropertyKey .CONTEXT_SELECTOR_CLASS_NAME .getSystemKey ());
7967 System .getProperties ().remove (Log4jPropertyKey .CONFIG_CONFIGURATION_FACTORY_CLASS_NAME .getSystemKey ());
8068 }
8169 }
0 commit comments