Search in sources :

Example 46 with Attribute

use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.

the class TestBadLFCController method getNoFieldController.

private Element getNoFieldController() {
    Element elem = new Element("component", "");
    elem.addAttribute(new Attribute("classname", clazz));
    Element controller = new Element("controller", "");
    elem.addElement(controller);
    return elem;
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Example 47 with Attribute

use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.

the class TestBadServiceDependencies method getMissingCallbackType.

private Element getMissingCallbackType() {
    Element elem = new Element("component", "");
    elem.addAttribute(new Attribute("classname", clazz));
    // iPOJO cannot determine the specification of this type of dependency.
    Element dependency = new Element("requires", "");
    dependency.addAttribute(new Attribute("field", "fs"));
    Element callback = new Element("callback", "");
    // callback.addAttribute(new Attribute("type", "bind")); --> Type missing.
    callback.addAttribute(new Attribute("method", "refBind"));
    dependency.addElement(callback);
    elem.addElement(dependency);
    elem.addElement(manipulation);
    return elem;
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Example 48 with Attribute

use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.

the class TestBadServiceDependencies method getMissingSpecification.

private Element getMissingSpecification() {
    Element elem = new Element("component", "");
    elem.addAttribute(new Attribute("classname", clazz));
    // iPOJO cannot determine the specification of this type of dependency.
    Element dependency = new Element("requires", "");
    Element callback = new Element("callback", "");
    callback.addAttribute(new Attribute("type", "bind"));
    callback.addAttribute(new Attribute("method", "refBind"));
    dependency.addElement(callback);
    elem.addElement(dependency);
    elem.addElement(manipulation);
    return elem;
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Example 49 with Attribute

use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.

the class TestBadServiceDependencies method getMissingCallbackMethod.

private Element getMissingCallbackMethod() {
    Element elem = new Element("component", "");
    elem.addAttribute(new Attribute("classname", clazz));
    // iPOJO cannot determine the specification of this type of dependency.
    Element dependency = new Element("requires", "");
    dependency.addAttribute(new Attribute("field", "fs"));
    Element callback = new Element("callback", "");
    callback.addAttribute(new Attribute("type", "bind"));
    // callback.addAttribute(new Attribute("method", "refBind"));  --> Method missing.
    dependency.addElement(callback);
    elem.addElement(dependency);
    elem.addElement(manipulation);
    return elem;
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Example 50 with Attribute

use of org.apache.felix.ipojo.metadata.Attribute in project felix by apache.

the class TestBadServiceDependencies method getNoField.

private Element getNoField() {
    Element elem = new Element("component", "");
    elem.addAttribute(new Attribute("classname", clazz));
    Element callback = new Element("requires", "");
    callback.addAttribute(new Attribute("filter", "(foo=bar)"));
    elem.addElement(callback);
    elem.addElement(manipulation);
    return elem;
}
Also used : Attribute(org.apache.felix.ipojo.metadata.Attribute) Element(org.apache.felix.ipojo.metadata.Element)

Aggregations

Attribute (org.apache.felix.ipojo.metadata.Attribute)125 Element (org.apache.felix.ipojo.metadata.Element)109 Test (org.junit.Test)9 PojoMetadata (org.apache.felix.ipojo.parser.PojoMetadata)6 Iterator (java.util.Iterator)4 Enumeration (java.util.Enumeration)3 Map (java.util.Map)3 Set (java.util.Set)3 ServiceReference (org.osgi.framework.ServiceReference)3 List (java.util.List)2 Entry (java.util.Map.Entry)2 PropertyDescription (org.apache.felix.ipojo.architecture.PropertyDescription)2 FieldMetadata (org.apache.felix.ipojo.parser.FieldMetadata)2 MethodMetadata (org.apache.felix.ipojo.parser.MethodMetadata)2 Type (org.objectweb.asm.Type)2 Member (java.lang.reflect.Member)1 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ExecutorService (java.util.concurrent.ExecutorService)1