Package org.apache.felix.ipojo.test.scenarios.service.dependency.service

Examples of org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService


        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
        assertEquals("check modify -1", ((Integer)props.get("modified")).intValue(), 1); // Already called inside the method
       
       
        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
        FooService fs = (FooService) getContext().getService(ref);
       
        fs.foo(); // Update
       
        props = cs.getProps();
        //Check properties
        assertTrue("check CheckService invocation -1.1", ((Boolean)props.get("result")).booleanValue());
        assertEquals("check void bind invocation -1.1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
View Full Code Here


        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);

        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
        FooService fs = (FooService) getContext().getService(ref);
       
        fs.foo(); // Update
       
        props = cs.getProps();
        //Check properties
        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
       
View Full Code Here

        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);

        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
        FooService fs = (FooService) getContext().getService(ref);
       
        fs.foo(); // Update
       
        props = cs.getProps();
        //Check properties
        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
       
View Full Code Here

        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);

        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
        FooService fs = (FooService) getContext().getService(ref);
       
        fs.foo(); // Update
       
        props = cs.getProps();
        //Check properties
        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
       
View Full Code Here

        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);

        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
        FooService fs = (FooService) getContext().getService(ref);
       
        fs.foo(); // Update
       
        props = cs.getProps();
        //Check properties
        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
       
View Full Code Here

            assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
            assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
            assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);

            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
            FooService fs = (FooService) getContext().getService(ref);
           
            fs.foo(); // Update
           
            props = cs.getProps();
            //Check properties
            assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
           
View Full Code Here

       
   
        // Increase the second provider grade.
        ServiceReference fs_ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider2.getInstanceName());
        assertNotNull("Check foo service (2) reference", fs_ref);
        FooService fs = (FooService) getContext().getService(fs_ref);
       
        fs.foo(); // Increase the grade (now = 2)
       
        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
        assertNotNull("Check CheckService availability", cs_ref);
        cs = (CheckService) getContext().getService(cs_ref);
        // Check grade
        grade = (Integer) cs.getProps().get("int");
        assertEquals("Check fourth grade", 2, grade.intValue());
       
        // Increase the other provider grade.
        fs_ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
        assertNotNull("Check foo service (1) reference", fs_ref);
        fs = (FooService) getContext().getService(fs_ref);
        fs.foo(); //(grade = 3)
       
        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
        assertNotNull("Check CheckService availability", cs_ref);
        cs = (CheckService) getContext().getService(cs_ref);
        // Check grade
View Full Code Here

        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
        assertNotNull(ref);
        CheckService cs = (CheckService) context.getService(ref);
       
        Properties props = cs.getProps();
        FooService helper = (FooService) props.get("helper.fs");
        assertNotNull(helper);
        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
       
        assertTrue(cs.check());
       
        fooProvider1.dispose();
        instance1.dispose();
View Full Code Here

        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
        assertNotNull(ref);
        CheckService cs = (CheckService) context.getService(ref);
       
        Properties props = cs.getProps();
        FooService helper = (FooService) props.get("helper.fs");
        assertNotNull(helper);
        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
       
        assertFalse(cs.check()); // Nullable.
       
        instance1.dispose();
    }
View Full Code Here

        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
        assertNotNull(ref);
        CheckService cs = (CheckService) context.getService(ref);
       
        Properties props = cs.getProps();
        FooService helper = (FooService) props.get("helper.fs");
        assertNotNull(helper);
        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.

       
        assertTrue(cs.check());
       
        fooProvider1.dispose();
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.test.scenarios.service.dependency.service.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.