Search in sources :

Example 1 with NullConfiguration

use of org.apache.logging.log4j.core.config.NullConfiguration in project logging-log4j2 by apache.

the class RequiredValidatorTest method testNullDefaultValue.

@Test
public void testNullDefaultValue() throws Exception {
    final ValidatingPlugin validatingPlugin = (ValidatingPlugin) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
    assertNull(validatingPlugin);
}
Also used : ValidatingPlugin(org.apache.logging.log4j.core.config.plugins.validation.ValidatingPlugin) PluginBuilder(org.apache.logging.log4j.core.config.plugins.util.PluginBuilder) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration) Test(org.junit.Test)

Example 2 with NullConfiguration

use of org.apache.logging.log4j.core.config.NullConfiguration in project logging-log4j2 by apache.

the class ValidatingPluginWithGenericBuilderTest method testNonNullValue.

@Test
public void testNonNullValue() throws Exception {
    node.getAttributes().put("name", "foo");
    final ValidatingPluginWithGenericBuilder validatingPlugin = (ValidatingPluginWithGenericBuilder) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
    assertNotNull(validatingPlugin);
    assertEquals("foo", validatingPlugin.getName());
}
Also used : PluginBuilder(org.apache.logging.log4j.core.config.plugins.util.PluginBuilder) ValidatingPluginWithGenericBuilder(org.apache.logging.log4j.core.config.plugins.validation.ValidatingPluginWithGenericBuilder) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration) Test(org.junit.Test)

Example 3 with NullConfiguration

use of org.apache.logging.log4j.core.config.NullConfiguration in project logging-log4j2 by apache.

the class ValidatingPluginWithTypedBuilderTest method testNullDefaultValue.

@Test
public void testNullDefaultValue() throws Exception {
    // @formatter:off
    final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
    // @formatter:on
    assertNull(validatingPlugin);
}
Also used : ValidatingPluginWithTypedBuilder(org.apache.logging.log4j.core.config.plugins.validation.ValidatingPluginWithTypedBuilder) PluginBuilder(org.apache.logging.log4j.core.config.plugins.util.PluginBuilder) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration) Test(org.junit.Test)

Example 4 with NullConfiguration

use of org.apache.logging.log4j.core.config.NullConfiguration in project logging-log4j2 by apache.

the class ValidatingPluginWithGenericBuilderTest method testNullDefaultValue.

@Test
public void testNullDefaultValue() throws Exception {
    final ValidatingPluginWithGenericBuilder validatingPlugin = (ValidatingPluginWithGenericBuilder) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
    assertNull(validatingPlugin);
}
Also used : PluginBuilder(org.apache.logging.log4j.core.config.plugins.util.PluginBuilder) ValidatingPluginWithGenericBuilder(org.apache.logging.log4j.core.config.plugins.validation.ValidatingPluginWithGenericBuilder) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration) Test(org.junit.Test)

Example 5 with NullConfiguration

use of org.apache.logging.log4j.core.config.NullConfiguration in project logging-log4j2 by apache.

the class GelfLayoutBenchmark method setUp.

@Setup
public void setUp() {
    System.setProperty("log4j2.enable.direct.encoders", "true");
    appender = new DemoAppender(GelfLayout.newBuilder().setConfiguration(new NullConfiguration()).setHost("host").setAdditionalFields(ADDITIONAL_FIELDS).setCompressionType(GelfLayout.CompressionType.OFF).setCompressionThreshold(0).setIncludeStacktrace(true).setIncludeThreadContext(true).build());
    j = 0;
}
Also used : DemoAppender(org.apache.logging.log4j.perf.util.DemoAppender) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration)

Aggregations

NullConfiguration (org.apache.logging.log4j.core.config.NullConfiguration)11 Test (org.junit.Test)10 PluginBuilder (org.apache.logging.log4j.core.config.plugins.util.PluginBuilder)8 Configuration (org.apache.logging.log4j.core.config.Configuration)2 PluginWithGenericSubclassFoo1Builder (org.apache.logging.log4j.core.config.plugins.validation.PluginWithGenericSubclassFoo1Builder)2 ValidatingPlugin (org.apache.logging.log4j.core.config.plugins.validation.ValidatingPlugin)2 ValidatingPluginWithGenericBuilder (org.apache.logging.log4j.core.config.plugins.validation.ValidatingPluginWithGenericBuilder)2 ValidatingPluginWithTypedBuilder (org.apache.logging.log4j.core.config.plugins.validation.ValidatingPluginWithTypedBuilder)2 DummyNanoClock (org.apache.logging.log4j.core.util.DummyNanoClock)2 SystemNanoClock (org.apache.logging.log4j.core.util.SystemNanoClock)2 DemoAppender (org.apache.logging.log4j.perf.util.DemoAppender)1