use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder in project logging-log4j2 by apache.
the class ValidatingPluginWithGenericSubclassFoo1BuilderTest method testNullDefaultValue.
@Test
public void testNullDefaultValue() throws Exception {
final PluginWithGenericSubclassFoo1Builder validatingPlugin = (PluginWithGenericSubclassFoo1Builder) 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 ValidatingPluginWithGenericSubclassFoo1BuilderTest method testNonNullValue.
@Test
public void testNonNullValue() throws Exception {
node.getAttributes().put("thing", "thing1");
node.getAttributes().put("foo1", "foo1");
final PluginWithGenericSubclassFoo1Builder validatingPlugin = (PluginWithGenericSubclassFoo1Builder) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
assertNotNull(validatingPlugin);
assertEquals("thing1", validatingPlugin.getThing());
assertEquals("foo1", validatingPlugin.getFoo1());
}
use of org.apache.logging.log4j.core.config.plugins.util.PluginBuilder in project logging-log4j2 by apache.
the class RequiredValidatorTest method testNonNullValue.
@Test
public void testNonNullValue() throws Exception {
node.getAttributes().put("name", "foo");
final ValidatingPlugin validatingPlugin = (ValidatingPlugin) new PluginBuilder(plugin).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
assertNotNull(validatingPlugin);
assertEquals("foo", validatingPlugin.getName());
}
Aggregations