use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder 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);
}
use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder 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());
}
use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder 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);
}
use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder 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);
}
use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder in project logging-log4j2 by apache.
the class ValidatingPluginWithTypedBuilderTest method testNonNullValue.
@Test
public void testNonNullValue() throws Exception {
node.getAttributes().put("name", "foo");
// @formatter:off
final ValidatingPluginWithTypedBuilder validatingPlugin = (ValidatingPluginWithTypedBuilder) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
// @formatter:on
assertNotNull(validatingPlugin);
assertEquals("foo", validatingPlugin.getName());
}
Aggregations