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

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


        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);

        osgiHelper.waitForService(FooService.class.getName(), "(instance.name=" + pid + ")", 1000);
        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), "(instance.name=" + pid + ")");

        Properties p = fs.fooProps();
        String mes = p.getProperty("message");
        int count = (Integer) p.get("count");
        // architecture = (Architecture) osgiHelper.getServiceObject( Architecture.class.getName(), "(architecture.instance="+pid+")");

        assertEquals("Assert Message", "message", mes);
View Full Code Here


        }

        System.out.println("===");

        fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), "(instance.name=" + pid + ")");
        p = fs.fooProps();
        mes = p.getProperty("message");
        count = (Integer) p.get("count");
        // architecture = (Architecture) osgiHelper.getServiceObject( Architecture.class.getName(), "(architecture.instance="+pid+")");

        assertEquals("Assert Message", "message2", mes);
View Full Code Here

        assertEquals("Check no object -2", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);

        //Invoke
        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), "(instance.name=" + pid + ")");
        Properties p = fs.fooProps();
        String mes = p.getProperty("message");
        int count = (Integer) p.get("count");
        // architecture = (Architecture) osgiHelper.getServiceObject( Architecture.class.getName(), "(architecture.instance="+pid+")");

        assertEquals("Assert Message", "message2", mes);
View Full Code Here

        }
        TimeUtils.grace(500);
        osgiHelper.waitForService(FooService.class, null, 10000);

        FooService fs1 = ipojoHelper.getServiceObjectByName(FooService.class, "complex1");
        Properties props1 = fs1.fooProps();
        Assert.assertTrue(((String)props1.get("content")).contains("I'm file 1"));
        Assert.assertEquals(((Bean)props1.get("bean")).getMessage(), "I'm 1");
        Assert.assertEquals(((Bean)props1.get("bean")).getCount(), 1);
        Assert.assertEquals(((Map<String, String>)props1.get("map")).get("a"), "b");
View Full Code Here

        Assert.assertEquals(((Bean)props1.get("bean")).getCount(), 1);
        Assert.assertEquals(((Map<String, String>)props1.get("map")).get("a"), "b");

        FooService fs2 = ipojoHelper.getServiceObjectByName(FooService.class, "complex2");
        Assert.assertNotNull(fs2);
        Properties props2 = fs2.fooProps();
        Assert.assertTrue(((String)props2.get("content")).contains("I'm file 2"));
        Assert.assertEquals(((Bean)props2.get("bean")).getMessage(), "I'm 2");
        Assert.assertEquals(((Bean)props2.get("bean")).getCount(), 2);
        Assert.assertEquals(((Map<String, String>)props2.get("map")).get("a"), "b2");
View Full Code Here

        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), instance.getInstanceName());
        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
        assertNotNull("FS availability", ref);

        FooService fs = (FooService) bc.getService(ref);
        Properties p = fs.fooProps();
        String mes = p.getProperty("message");
        int count = (Integer) p.get("count");
        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
        assertEquals("Check message", "message", mes);
        assertEquals("Check count", 1, count);
View Full Code Here

        ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), instance.getInstanceName());
        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
        assertNotNull("FS availability", ref);

        fs = (FooService) bc.getService(ref);
        p = fs.fooProps();
        mes = p.getProperty("message");
        count = (Integer) p.get("count");
        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
        if (mes.equals("message")) {
            System.out.println("Warning, configuration not yet applied");
View Full Code Here

        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
        assertNotNull("FS availability", ref);

        // arch = (Architecture) osgiHelper.getServiceObject( org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
        FooService fs = (FooService) bc.getService(ref);
        Properties p = fs.fooProps();
        String mes = p.getProperty("message");
        int count = (Integer) p.get("count");
        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
        assertEquals("Check message", "message", mes);
        assertEquals("Check count", 1, count);
View Full Code Here

        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
        assertNotNull("FS availability", ref);

        // arch = (Architecture) osgiHelper.getServiceObject( org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
        fs = (FooService) bc.getService(ref);
        p = fs.fooProps();
        mes = p.getProperty("message");
        count = (Integer) p.get("count");
        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
        if (mes.equals("message")) {
            System.out.println("Warning, configuration not yet applied");
View Full Code Here

        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), instance.getInstanceName());
        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
        assertNotNull("FS availability", ref);

        FooService fs = (FooService) bc.getService(ref);
        Properties p = fs.fooProps();
        String mes = p.getProperty("message");
        int count = (Integer) p.get("count");
        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
        assertEquals("Check message", "message2", mes); // Already reconfigured.
        assertEquals("Check count", 1, count);
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.