Package org.apache.felix.ipojo.runtime.core.services

Examples of org.apache.felix.ipojo.runtime.core.services.FooService


        assertNotNull("Cons1 Service available", refcons1);

        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        Long id = (Long) props.get("id");
        FooService fscons1 = (FooService) props.get("object");
        assertEquals("id 1", 1, id.intValue());
        checkCreatedObjects(prov, 1);


        // Step 2 : create a second consumer
        cons2.start();
        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);

        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        Long id2 = (Long) props2.get("id");
        FooService fscons2 = (FooService) props2.get("object");
        assertEquals("id 2", 2, id2.intValue());
        checkCreatedObjects(prov, 2);

        assertNotSame("Two objects", fscons1, fscons2);
View Full Code Here


        // The two consumers are started and use their own objects.
        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
        assertNotNull("Cons1 Service available", refcons1);
        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        FooService fscons1 = (FooService) props.get("object");

        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);
        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        FooService fscons2 = (FooService) props2.get("object");

        checkCreatedObjects(prov, 2);
        assertNotSame("Two objects", fscons1, fscons2);

        // Stop the provider
View Full Code Here

        assertNotNull("Cons1 Service available", refcons1);

        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        Long id = (Long) props.get("id");
        FooService fscons1 = (FooService) props.get("object");
        assertEquals("id 1", 1, id.intValue());
        checkCreatedObjects(prov2, 1);


        // Step 2 : create a second consumer
        cons3.start();
        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);

        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        Long id2 = (Long) props2.get("id");
        FooService fscons2 = (FooService) props2.get("object");
        assertEquals("id 2", 2, id2.intValue());
        checkCreatedObjects(prov2, 2);


        assertNotSame("Two objects", fscons1, fscons2);
View Full Code Here

        assertNotNull("Cons1 Service available", refcons1);

        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        Long id = (Long) props.get("id");
        FooService fscons1 = (FooService) props.get("object");
        assertEquals("id 1", 1, id.intValue());
        checkCreatedObjects(prov, 1);


        // Step 2 : create a second consumer
        cons2.start();
        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);

        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        Long id2 = (Long) props2.get("id");
        FooService fscons2 = (FooService) props2.get("object");
        assertEquals("id 2", 2, id2.intValue());
        checkCreatedObjects(prov, 2);

        assertNotSame("Two objects", fscons1, fscons2);
View Full Code Here

        // The two consumers are started and use their own objects.
        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
        assertNotNull("Cons1 Service available", refcons1);
        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        FooService fscons1 = (FooService) props.get("object");

        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);
        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        FooService fscons2 = (FooService) props2.get("object");

        checkCreatedObjects(prov, 2);
        assertNotSame("Two objects", fscons1, fscons2);

        // Stop the provider
View Full Code Here

        assertNotNull("Cons1 Service available", refcons1);

        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        Long id = (Long) props.get("id");
        FooService fscons1 = (FooService) props.get("object");
        assertEquals("id 1", 1, id.intValue());
        checkCreatedObjects(prov2, 1);


        // Step 2 : create a second consumer
        cons3.start();
        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);

        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        Long id2 = (Long) props2.get("id");
        FooService fscons2 = (FooService) props2.get("object");
        assertEquals("id 2", 2, id2.intValue());
        checkCreatedObjects(prov2, 2);


        assertNotSame("Two objects", fscons1, fscons2);
View Full Code Here

        assertNotNull("Cons1 Service available", refcons1);

        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        Long id = (Long) props.get("id");
        FooService fscons1 = (FooService) props.get("object");
        assertEquals("id 1", 1, id.intValue());
        checkCreatedObjects(prov, 1);


        // Step 2 : create a second consumer
        cons2.start();
        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);

        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        Long id2 = (Long) props2.get("id");
        FooService fscons2 = (FooService) props2.get("object");
        assertEquals("id 2", 2, id2.intValue());
        checkCreatedObjects(prov, 2);

        assertNotSame("Two objects", fscons1, fscons2);
View Full Code Here

        // The two consumers are started and use their own objects.
        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
        assertNotNull("Cons1 Service available", refcons1);
        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        FooService fscons1 = (FooService) props.get("object");

        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);
        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        FooService fscons2 = (FooService) props2.get("object");

        checkCreatedObjects(prov, 2);
        assertNotSame("Two objects", fscons1, fscons2);

        // Stop the provider
View Full Code Here

        assertNotNull("Cons1 Service available", refcons1);

        CheckService cs_cons1 = (CheckService) osgiHelper.getRawServiceObject(refcons1);
        Properties props = cs_cons1.getProps();
        Long id = (Long) props.get("id");
        FooService fscons1 = (FooService) props.get("object");
        assertEquals("id 1", 1, id.intValue());
        checkCreatedObjects(prov2, 1);


        // Step 2 : create a second consumer
        cons3.start();
        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
        assertNotNull("Cons2 Service available", refcons2);

        CheckService cs_cons2 = (CheckService) osgiHelper.getRawServiceObject(refcons2);
        Properties props2 = cs_cons2.getProps();
        Long id2 = (Long) props2.get("id");
        FooService fscons2 = (FooService) props2.get("object");
        assertEquals("id 2", 2, id2.intValue());
        checkCreatedObjects(prov2, 2);


        assertNotSame("Two objects", fscons1, fscons2);
View Full Code Here

                fail("Check the intAProp Equality");
            }
        }

        // Invoke
        FooService fs = (FooService) osgiHelper.getRawServiceObject(sr);
        assertTrue("invoke fs", fs.foo());

        // Re-check the property (change)
        intProp = (Integer) sr.getProperty("int");
        boolProp = (Boolean) sr.getProperty("boolean");
        strProp = (String) sr.getProperty("string");
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.runtime.core.services.FooService

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.