Package org.apache.felix.ipojo

Examples of org.apache.felix.ipojo.ComponentFactory.start()


        m_publisher.addAttribute(malformedTopics);

        // Create and try to start the factory
        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
        try {
            fact.start();
            // Should not be executed
            fact.stop();
            fail("The factory must not start when invalid topics are specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here


        // Remove the topics attribute of the publisher and replace with a
        // malformed one
        m_publisher.removeAttribute(m_publisherTopics);
        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
        fact.start();

        // Try to create an instance with malformed specified topics
        Dictionary conf = new Hashtable();
        conf.put("instance.name","provider with malformed topics");
        Dictionary topics = new Hashtable();
View Full Code Here

        m_subscriber.removeAttribute(m_subscriberName);

        // Create and try to start the factory
        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
        try {
            fact.start();
            // Should not be executed
            fact.stop();
            fail("The factory must not start when no name is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        m_subscriber.removeAttribute(m_subscriberCallback);

        // Create and try to start the factory
        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
        try {
            fact.start();
            // Should not be executed
            fact.stop();
            fail("The factory must not start when no callback is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        UnacceptableConfiguration {

        // Remove the topics attribute of the subscriber
        m_subscriber.removeAttribute(m_subscriberTopics);
        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
        fact.start();

        // Try to create an instance without specified topics
        Dictionary conf = new Hashtable();
        conf.put("instance.name","consumer without topics");
        conf.put("slow", "false");
View Full Code Here

        m_subscriber.addAttribute(malformedTopics);

        // Create and try to start the factory
        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
        try {
            fact.start();
            // Should not be executed
            fact.stop();
            fail("The factory must not start when invalid topics are specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        // Remove the topics attribute of the subscriber and replace with a
        // malformed one
        m_subscriber.removeAttribute(m_subscriberTopics);
        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
        fact.start();

        // Try to create an instance with malformed specified topics
        Dictionary conf = new Hashtable();
        conf.put("instance.name","consumer with malformed topics");
        Dictionary topics = new Hashtable();
View Full Code Here

    }
   
    public void testNoField() {
        try {
            ComponentFactory cf = new ComponentFactory(getContext(), getNoFieldController());
            cf.start();
            cf.stop();
            fail("A lifecycle controller with a missing field must be rejected " + cf);
        } catch (Exception e) {
            // OK
        }
View Full Code Here

    }
   
    public void testBadField() {
        try {
            ComponentFactory cf = new ComponentFactory(getContext(), getBadFieldController());
            cf.start();
            cf.stop();
            fail("A lifecycle controller with a bad field must be rejected " + cf);
        } catch (Exception e) {
            // OK
        }
View Full Code Here

    }
   
    public void testNothing() {
        try {
            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
            cf.start();
            ComponentInstance ci = cf.createComponentInstance(props);
            ci.dispose();
            cf.stop();
            fail("A service requirement with neither field and method must be rejected " + cf);
        } catch (ConfigurationException e) {
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.