use of org.apache.logging.log4j.plugins.test.validation.PluginWithGenericSubclassFoo1Builder in project logging-log4j2 by apache.
the class ValidatingPluginWithGenericSubclassFoo1BuilderTest method setUp.
@SuppressWarnings("unchecked")
@BeforeEach
public void setUp() throws Exception {
final PluginManager manager = new PluginManager("Test");
manager.collectPlugins();
plugin = (PluginType<PluginWithGenericSubclassFoo1Builder>) manager.getPluginType("PluginWithGenericSubclassFoo1Builder");
assertNotNull(plugin, "Rebuild this module to make sure annotation processing kicks in.");
node = new Node(null, "Validator", plugin);
}
use of org.apache.logging.log4j.plugins.test.validation.PluginWithGenericSubclassFoo1Builder in project logging-log4j2 by apache.
the class ValidatingPluginWithGenericSubclassFoo1BuilderTest method testNullDefaultValue.
@Test
public void testNullDefaultValue() throws Exception {
final PluginWithGenericSubclassFoo1Builder validatingPlugin = (PluginWithGenericSubclassFoo1Builder) new PluginBuilder(plugin).setConfiguration(new NullConfiguration()).setConfigurationNode(node).build();
assertNull(validatingPlugin);
}
use of org.apache.logging.log4j.plugins.test.validation.PluginWithGenericSubclassFoo1Builder 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).setConfiguration(new NullConfiguration()).setConfigurationNode(node).build();
assertNotNull(validatingPlugin);
assertEquals("thing1", validatingPlugin.getThing());
assertEquals("foo1", validatingPlugin.getFoo1());
}
Aggregations