use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class HandlerDeclarationVisitorTestCase method testElementConversionWithNoNamespace.
public void testElementConversionWithNoNamespace() throws Exception {
visitor.visit(null, "<testing/>");
visitor.visitEnd();
Element produced = workbench.build();
Element testing = produced.getElements("testing")[0];
assertEquals(0, testing.getElements().length);
assertEquals(0, testing.getAttributes().length);
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class ManipulatedMetadataFilterTestCase method testDoNotFilterOthers.
public void testDoNotFilterOthers() throws Exception {
Element main = new Element("test", null);
main.addAttribute(new Attribute("name", "setPropertyName"));
Assert.assertFalse(filter.accept(main));
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class MetadataRendererTestCase method testRenderElementWithNoNamespaceAttribute.
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);
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class MetadataRendererTestCase method testRenderElementWithEmptyNamespace.
public void testRenderElementWithEmptyNamespace() throws Exception {
Element main = new Element("test", "");
String rendered = renderer.render(main);
Assert.assertEquals("test { }", rendered);
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class MetadataRendererTestCase method testRenderElementWithChildren.
public void testRenderElementWithChildren() throws Exception {
Element main = new Element("test", null);
Element child = new Element("child", null);
main.addElement(child);
String rendered = renderer.render(main);
Assert.assertEquals("test { child { }}", rendered);
}
Aggregations