Examples of DonutProvider


Examples of org.apache.felix.ipojo.handler.eventadmin.test.donut.DonutProvider

        ComponentInstance providerInstance = providerFactory
                .createComponentInstance(properties);
        ServiceReference providerService = ipojoHelper
                .getServiceReferenceByName(DonutProvider.class
                        .getName(), providerInstance.getInstanceName());
        DonutProvider provider = (DonutProvider) bc
                .getService(providerService);

        // The consumer
        properties = new Hashtable();
        ComponentFactory consumerFactory = new ComponentFactory(bc,
                m_consumer);
        consumerFactory.start();
        properties.put("instance.name", "Homer Simpson");
        properties.put("slow", "false");
        ComponentInstance consumerInstance = consumerFactory
                .createComponentInstance(properties);
        ServiceReference consumerService = ipojoHelper
                .getServiceReferenceByName(DonutConsumer.class
                        .getName(), consumerInstance.getInstanceName());
        DonutConsumer consumer = (DonutConsumer) bc
                .getService(consumerService);

        /**
         * Test the normal behaviour of the instances.
         */
        consumer.clearDonuts();
        Donut sentDonut = provider.sellDonut();
        Donut receivedDonut = consumer.waitForDonut();
        assertEquals("The received donut must be the same as the sent one.",
                sentDonut, receivedDonut);

        /**
 
View Full Code Here

Examples of org.apache.felix.ipojo.test.donut.DonutProvider

        ComponentInstance providerInstance = providerFactory
                .createComponentInstance(properties);
        ServiceReference providerService = IPojoTestUtils
                .getServiceReferenceByName(getContext(), DonutProvider.class
                        .getName(), providerInstance.getInstanceName());
        DonutProvider provider = (DonutProvider) getContext()
                .getService(providerService);

        // 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
                .getServiceReferenceByName(getContext(), DonutConsumer.class
                        .getName(), consumerInstance.getInstanceName());
        DonutConsumer consumer = (DonutConsumer) getContext()
                .getService(consumerService);

        /**
         * Test the normal behaviour of the instances.
         */
        consumer.clearDonuts();
        Donut sentDonut = provider.sellDonut();
        Donut receivedDonut = consumer.waitForDonut();
        assertEquals("The received donut must be the same as the sent one.",
                sentDonut, receivedDonut);

        /**
 
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.