use of org.apache.logging.log4j.core.config.plugins.validation.ValidatingPlugin 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.validation.ValidatingPlugin 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());
}
use of org.apache.logging.log4j.core.config.plugins.validation.ValidatingPlugin in project logging-log4j2 by apache.
the class RequiredValidatorTest method setUp.
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
final PluginManager manager = new PluginManager("Test");
manager.collectPlugins();
plugin = (PluginType<ValidatingPlugin>) manager.getPluginType("Validator");
assertNotNull("Rebuild this module to make sure annotaion processing kicks in.", plugin);
node = new Node(null, "Validator", plugin);
}
Aggregations