Search in sources :

Example 1 with PluginWithGenericSubclassFoo1Builder

use of org.apache.logging.log4j.core.config.plugins.validation.PluginWithGenericSubclassFoo1Builder in project logging-log4j2 by apache.

the class ValidatingPluginWithGenericSubclassFoo1BuilderTest method setUp.

@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
    final PluginManager manager = new PluginManager("Test");
    manager.collectPlugins();
    plugin = (PluginType<PluginWithGenericSubclassFoo1Builder>) manager.getPluginType("PluginWithGenericSubclassFoo1Builder");
    assertNotNull("Rebuild this module to make sure annotaion processing kicks in.", plugin);
    node = new Node(null, "Validator", plugin);
}
Also used : PluginManager(org.apache.logging.log4j.core.config.plugins.util.PluginManager) PluginWithGenericSubclassFoo1Builder(org.apache.logging.log4j.core.config.plugins.validation.PluginWithGenericSubclassFoo1Builder) Node(org.apache.logging.log4j.core.config.Node) Before(org.junit.Before)

Example 2 with PluginWithGenericSubclassFoo1Builder

use of org.apache.logging.log4j.core.config.plugins.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).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
    assertNull(validatingPlugin);
}
Also used : PluginWithGenericSubclassFoo1Builder(org.apache.logging.log4j.core.config.plugins.validation.PluginWithGenericSubclassFoo1Builder) PluginBuilder(org.apache.logging.log4j.core.config.plugins.util.PluginBuilder) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration) Test(org.junit.Test)

Example 3 with PluginWithGenericSubclassFoo1Builder

use of org.apache.logging.log4j.core.config.plugins.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).withConfiguration(new NullConfiguration()).withConfigurationNode(node).build();
    assertNotNull(validatingPlugin);
    assertEquals("thing1", validatingPlugin.getThing());
    assertEquals("foo1", validatingPlugin.getFoo1());
}
Also used : PluginWithGenericSubclassFoo1Builder(org.apache.logging.log4j.core.config.plugins.validation.PluginWithGenericSubclassFoo1Builder) PluginBuilder(org.apache.logging.log4j.core.config.plugins.util.PluginBuilder) NullConfiguration(org.apache.logging.log4j.core.config.NullConfiguration) Test(org.junit.Test)

Aggregations

PluginWithGenericSubclassFoo1Builder (org.apache.logging.log4j.core.config.plugins.validation.PluginWithGenericSubclassFoo1Builder)3 NullConfiguration (org.apache.logging.log4j.core.config.NullConfiguration)2 PluginBuilder (org.apache.logging.log4j.core.config.plugins.util.PluginBuilder)2 Test (org.junit.Test)2 Node (org.apache.logging.log4j.core.config.Node)1 PluginManager (org.apache.logging.log4j.core.config.plugins.util.PluginManager)1 Before (org.junit.Before)1