@@ -47,19 +47,11 @@ public class ConfigurationAssemblerTest {
47
47
48
48
@ Test
49
49
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 );
63
55
}
64
56
}
65
57
@@ -69,13 +61,9 @@ public void testCustomConfigurationFactory() throws Exception {
69
61
System .setProperty (
70
62
Log4jPropertyKey .CONFIG_CONFIGURATION_FACTORY_CLASS_NAME .getSystemKey (),
71
63
"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" );
75
64
final Configuration config = ((LoggerContext ) LogManager .getContext (false )).getConfiguration ();
76
65
validate (config );
77
66
} finally {
78
- System .getProperties ().remove (Log4jPropertyKey .CONTEXT_SELECTOR_CLASS_NAME .getSystemKey ());
79
67
System .getProperties ().remove (Log4jPropertyKey .CONFIG_CONFIGURATION_FACTORY_CLASS_NAME .getSystemKey ());
80
68
}
81
69
}
0 commit comments