Package org.apache.felix.ipojo.metadata

Examples of org.apache.felix.ipojo.metadata.Element.addAttribute()


    private Element newManipulationElement(boolean complete) {
        Element manipulation = new Element("manipulation", null);
        if (complete) {
            Element field = new Element("field", null);
            field.addAttribute(new Attribute("name", "property"));
            manipulation.addElement(field);
        }

        return manipulation;
    }
View Full Code Here


    }

    private Element newComponentElement() {
        Element component = new Element("component", null);
        Element requires = new Element("requires", null);
        requires.addAttribute(new Attribute("field", "property"));
        component.addElement(requires);

        return component;
    }
}
View Full Code Here

        assertEquals(2, meta.size());
    }

    private Element newComponentElement(String type) {
        Element main = new Element("component", null);
        main.addAttribute(new Attribute("name", type));
        return main;
    }

    private Element newInstanceElement(String type, String name) {
        Element main = new Element("instance", null);
View Full Code Here

        return main;
    }

    private Element newInstanceElement(String type, String name) {
        Element main = new Element("instance", null);
        main.addAttribute(new Attribute("component", type));
        main.addAttribute(new Attribute("name", name));
        return main;
    }
}
View Full Code Here

    }

    private Element newInstanceElement(String type, String name) {
        Element main = new Element("instance", null);
        main.addAttribute(new Attribute("component", type));
        main.addAttribute(new Attribute("name", name));
        return main;
    }
}
View Full Code Here

        filter = new ManipulatedMetadataFilter();
    }

    public void testFilterPrefixedMethod() throws Exception {
        Element main = new Element("test", null);
        main.addAttribute(new Attribute("name", ClassManipulator.PREFIX + "PropertyName"));

        Assert.assertTrue(filter.accept(main));
    }

    public void testFilterInstanceManagerValue() throws Exception {
View Full Code Here

        Assert.assertTrue(filter.accept(main));
    }

    public void testFilterInstanceManagerValue() throws Exception {
        Element main = new Element("test", null);
        main.addAttribute(new Attribute("name", InstanceManager.class.getName()));

        Assert.assertTrue(filter.accept(main));
    }

    public void testFilterInstanceManagerSetter() throws Exception {
View Full Code Here

        Assert.assertTrue(filter.accept(main));
    }

    public void testFilterInstanceManagerSetter() throws Exception {
        Element main = new Element("test", null);
        main.addAttribute(new Attribute("name", "_setInstanceManager"));

        Assert.assertTrue(filter.accept(main));
    }

    public void testDoNotFilterOthers() throws Exception {
View Full Code Here

        Assert.assertTrue(filter.accept(main));
    }

    public void testDoNotFilterOthers() throws Exception {
        Element main = new Element("test", null);
        main.addAttribute(new Attribute("name", "setPropertyName"));

        Assert.assertFalse(filter.accept(main));
    }
}
View Full Code Here

        Assert.assertEquals("http://felix.apache.org/ipojo/testing:test { }", rendered);
    }

    public void testRenderElementWithNoNamespaceAttribute() throws Exception {
        Element main = new Element("test", null);
        main.addAttribute(new Attribute("name", "attribute"));
        String rendered = renderer.render(main);
        Assert.assertEquals("test { $name=\"attribute\" }", rendered);
    }

    public void testRenderElementWithNamespaceAttribute() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.