Skip to content

Commit

Permalink
Remove references to async context selector in log4j-script
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Jan 26, 2024
1 parent e165098 commit de345cc
Showing 1 changed file with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,11 @@ public class ConfigurationAssemblerTest {

@Test
public void testBuildConfiguration() throws Exception {
try {
System.setProperty(
Log4jPropertyKey.CONTEXT_SELECTOR_CLASS_NAME.getSystemKey(),
"org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
final ConfigurationBuilder<BuiltConfiguration> builder =
ConfigurationBuilderFactory.newConfigurationBuilder();
CustomConfigurationFactory.addTestFixtures("config name", builder);
final Configuration configuration = builder.build();
try (final LoggerContext ctx = Configurator.initialize(configuration)) {
validate(configuration);
}
} finally {
System.getProperties().remove(Log4jPropertyKey.CONTEXT_SELECTOR_CLASS_NAME.getSystemKey());
final ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
CustomConfigurationFactory.addTestFixtures("config name", builder);
final Configuration configuration = builder.build();
try (final LoggerContext ctx = Configurator.initialize(configuration)) {
validate(configuration);
}
}

Expand All @@ -69,13 +61,9 @@ public void testCustomConfigurationFactory() throws Exception {
System.setProperty(
Log4jPropertyKey.CONFIG_CONFIGURATION_FACTORY_CLASS_NAME.getSystemKey(),
"org.apache.logging.log4j.script.config.builder.CustomConfigurationFactory");
System.setProperty(
Log4jPropertyKey.CONTEXT_SELECTOR_CLASS_NAME.getSystemKey(),
"org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
final Configuration config = ((LoggerContext) LogManager.getContext(false)).getConfiguration();
validate(config);
} finally {
System.getProperties().remove(Log4jPropertyKey.CONTEXT_SELECTOR_CLASS_NAME.getSystemKey());
System.getProperties().remove(Log4jPropertyKey.CONFIG_CONFIGURATION_FACTORY_CLASS_NAME.getSystemKey());
}
}
Expand Down

0 comments on commit de345cc

Please sign in to comment.