Package org.apache.felix.ipojo.metadata

Examples of org.apache.felix.ipojo.metadata.Attribute


    }

    @Test
    public void testNoManipulationMetadata() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
        try {
            ComponentFactory fact = new ComponentFactory(osgiHelper.getContext(), elem);
            fact.stop();
            fail("A factory with no manipulation metadata must be rejected");
        } catch (ConfigurationException e) {
View Full Code Here


    }


    private Element getNothing() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));

        Element callback = new Element("requires", "");
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
View Full Code Here

        return elem;
    }

    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;
    }
View Full Code Here

        return elem;
    }

    private Element getBadField() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));

        Element callback = new Element("requires", "");
        callback.addAttribute(new Attribute("field", "BAD_FIELD")); // missing field.
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }

    private Element getBadFilter() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));

        Element callback = new Element("requires", "");
        callback.addAttribute(new Attribute("field", "fs"));
        callback.addAttribute(new Attribute("filter", "(foo=bar)&(bar=foo)")); // Incorrect filter
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }

    private Element getBadFrom() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));

        Element callback = new Element("requires", "");
        callback.addAttribute(new Attribute("field", "fs"));
        callback.addAttribute(new Attribute("from", "ba(d&_")); // Incorrect from
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }

    private Element getBadType() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", clazz));

        Element callback = new Element("requires", "");
        callback.addAttribute(new Attribute("field", "fs"));
        callback.addAttribute(new Attribute("interface", BarService.class.getName()));
        elem.addElement(callback);
        elem.addElement(manipulation);
        return elem;
    }
View Full Code Here

        return elem;
    }

    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;
View Full Code Here

        return elem;
    }

    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;
View Full Code Here

        return elem;
    }

    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);
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.metadata.Attribute

Copyright © 2018 www.massapicom. 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.