Search in sources :

Example 66 with Element

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);
}
Also used : Element(org.apache.felix.ipojo.metadata.Element)

Example 67 with Element

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));
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Example 68 with Element

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);
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Example 69 with Element

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);
}
Also used : Element(org.apache.felix.ipojo.metadata.Element)

Example 70 with Element

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);
}
Also used : Element(org.apache.felix.ipojo.metadata.Element)

Aggregations

Element (org.apache.felix.ipojo.metadata.Element)400 Test (org.junit.Test)126 Attribute (org.apache.felix.ipojo.metadata.Attribute)109 ConfigurationException (org.apache.felix.ipojo.ConfigurationException)22 ParseException (org.apache.felix.ipojo.parser.ParseException)14 PojoMetadata (org.apache.felix.ipojo.parser.PojoMetadata)14 ArrayList (java.util.ArrayList)13 Reporter (org.apache.felix.ipojo.manipulator.Reporter)12 FieldMetadata (org.apache.felix.ipojo.parser.FieldMetadata)12 Dictionary (java.util.Dictionary)10 Properties (java.util.Properties)10 MethodMetadata (org.apache.felix.ipojo.parser.MethodMetadata)10 BaseTest (org.ow2.chameleon.testing.helpers.BaseTest)10 PropertyDescription (org.apache.felix.ipojo.architecture.PropertyDescription)9 IOException (java.io.IOException)8 List (java.util.List)8 Before (org.junit.Before)7 Enumeration (java.util.Enumeration)6 ComponentWorkbench (org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench)6 FooService (org.apache.felix.ipojo.runtime.core.services.FooService)6