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

Examples of org.apache.felix.ipojo.runtime.core.services.FooService.foo()


        ServiceContext sc = getServiceContext(import2);
        ServiceReference[] refs = ipojoHelper.getServiceReferences(sc, FooService.class.getName(), null);
        assertNotNull("Test foo availability inside the composite - 1", refs);
        assertEquals("Test foo availability inside the composite - 1.2 (" + refs.length + ")", refs.length, 2);
        FooService fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        FooService fs2 = (FooService) sc.getService(refs[1]);
        assertTrue("Test foo invocation", fs2.foo());
        sc.ungetService(refs[0]);
        sc.ungetService(refs[1]);
View Full Code Here


        assertNotNull("Test foo availability inside the composite - 1", refs);
        assertEquals("Test foo availability inside the composite - 1.2 (" + refs.length + ")", refs.length, 2);
        FooService fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        FooService fs2 = (FooService) sc.getService(refs[1]);
        assertTrue("Test foo invocation", fs2.foo());
        sc.ungetService(refs[0]);
        sc.ungetService(refs[1]);

        // Stop the first provider
        foo1.stop();
View Full Code Here

        ServiceContext sc = getServiceContext(import1);
        ServiceReference[] refs = ipojoHelper.getServiceReferences(sc, FooService.class.getName(), null);
        assertNotNull("Test foo availability inside the composite - 1", refs);
        assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
        FooService fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        sc.ungetService(refs[0]);

        foo1.stop();
        assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
        sc = getServiceContext(import1);
View Full Code Here

        sc = getServiceContext(import1);
        refs = ipojoHelper.getServiceReferences(sc, FooService.class.getName(), null);
        assertNotNull("Test foo availability inside the composite - 1", refs);
        assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
        fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        sc.ungetService(refs[0]);

        // Stop the second provider
        foo2.stop();
        assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
View Full Code Here

        sc = getServiceContext(import1);
        refs = ipojoHelper.getServiceReferences(sc, FooService.class.getName(), null);
        assertNotNull("Test foo availability inside the composite - 3", refs);
        assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
        fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        sc.ungetService(refs[0]);
    }

    @Test
    @Ignore("known as broken after interception inception in service dependencies")
View Full Code Here

        ServiceContext sc = getServiceContext(import1);
        ServiceReference[] refs = ipojoHelper.getServiceReferences(sc, FooService.class.getName(), null);
        assertNotNull("Test foo availability inside the composite - 1", refs);
        assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
        FooService fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        sc.ungetService(refs[0]);

        foo2.stop();
        assertTrue("Test component invalidity - 1", import1.getState() == ComponentInstance.INVALID);
View Full Code Here

        sc = getServiceContext(import1);
        refs = ipojoHelper.getServiceReferences(sc, FooService.class.getName(), null);
        assertNotNull("Test foo availability inside the composite - 3", refs);
        assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
        fs = (FooService) sc.getService(refs[0]);
        assertTrue("Test foo invocation", fs.foo());
        sc.ungetService(refs[0]);
    }

}
View Full Code Here

            }
        }

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

            }
        }

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

            }
        }

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