Package org.apache.felix.ipojo

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


        m_subscriber.addAttribute(unknownType);

        // 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 unknown data type is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here


        m_subscriber.addAttribute(unknownType);

        // 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 unappropriated data type is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        Dictionary properties = new Hashtable();

        // Provider
        ComponentFactory providerFactory = new ComponentFactory(getContext(),
                m_provider);
        providerFactory.start();
        properties.put("instance.name","Emperor of donuts");
        ComponentInstance providerInstance = providerFactory
                .createComponentInstance(properties);
        ServiceReference providerService = IPojoTestUtils
                .getServiceReferenceByName(getContext(), DonutProvider.class
View Full Code Here

        // The consumer
        properties = new Hashtable();
        ComponentFactory consumerFactory = new ComponentFactory(getContext(),
                m_consumer);
        consumerFactory.start();
        properties.put("instance.name","Homer Simpson");
        properties.put("slow", "false");
        ComponentInstance consumerInstance = consumerFactory
                .createComponentInstance(properties);
        ServiceReference consumerService = IPojoTestUtils
View Full Code Here

        m_publisher.removeAttribute(m_publisherName);

        // 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 no name is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        m_publisher.removeAttribute(m_publisherField);

        // 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 no field is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        m_publisher.addAttribute(unexistingField);

        // 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 an unexisting field is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        m_publisher.addAttribute(badTypedField);

        // 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 an bad typed field is specified.");
        } catch (IllegalStateException e) {
            // OK
View Full Code Here

        UnacceptableConfiguration {

        // Remove the topics attribute of the publisher
        m_publisher.removeAttribute(m_publisherTopics);
        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
        fact.start();

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

        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

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.