Package org.apache.felix.scr.integration.components

Examples of org.apache.felix.scr.integration.components.MutatingService


        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );

        //update theValue
        MutatingService s = ( MutatingService ) bundleContext.getService(serviceReference );
        Assert.assertNotNull(s);
        findComponentConfigurationByName(componentName, ComponentConfigurationDTO.ACTIVE);
        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
        s.updateProperties(d);
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //configure with configAdmin
        configure( componentName );
        delay();
        //no change
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //check that removing config switches back to defaults modified by config admin
        s.updateProperties(null);
        checkProperties( serviceReference, 8, "theValue", "p1", "p2" );

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here


        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );

        //update theValue
        MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );
        Assert.assertNotNull(s);
        checkProperties( serviceReference, 8, "anotherValue1", "p1", "p2" );
        findComponentConfigurationByName(componentName, ComponentConfigurationDTO.ACTIVE);
        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
        s.updateProperties(d);
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //configure with configAdmin
        configure( componentName );
        delay();
        delay();
        //no change
        checkProperties(serviceReference, 8, "anotherValue2", "p1", "p2");

        //check that removing config switches back to defaults modified by config admin
        s.updateProperties(null);
        checkProperties( serviceReference, 8, "theValue", "p1", "p2" );

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here

        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );

        //update theValue
        MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );
        Assert.assertNotNull(s);
        checkProperties( serviceReference, 8, "anotherValue1", "p1", "p2" );
        findComponentConfigurationByName(componentName, ComponentConfigurationDTO.ACTIVE);
        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
        s.updateProperties(d);
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //configure with configAdmin
        configure( componentName );
        delay();
        delay();
        //no change
        checkProperties(serviceReference, 8, "anotherValue2", "p1", "p2");

        //check that removing config switches back to defaults modified by config admin
        s.updateProperties(null);
        checkProperties( serviceReference, 8, "theValue", "p1", "p2" );

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here

        ServiceReference[] serviceReferences = bundleContext.getServiceReferences( MutatingService.class.getName(), "(service.pid=" + componentName + ")" );
        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );
        MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );

        SimpleServiceImpl srv1 = SimpleServiceImpl.create( bundleContext, "srv1" );
        checkProperties( serviceReference, 5, null, "p1", "p2" );
        Assert.assertEquals("bound", serviceReference.getProperty("SimpleService"));
View Full Code Here

        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );

        //update theValue
        MutatingService s = ( MutatingService ) bundleContext.getService(serviceReference );
        Assert.assertNotNull(s);
        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
        s.updateProperties(d);
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //configure with configAdmin
        configure( componentName );
        delay();
        //no change
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //check that removing config switches back to defaults modified by config admin
        s.updateProperties(null);
        checkProperties( serviceReference, 8, "theValue", "p1", "p2" );

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here

        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );

        //update theValue
        MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );
        Assert.assertNotNull(s);
        checkProperties( serviceReference, 8, "anotherValue1", "p1", "p2" );
        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
        s.updateProperties(d);
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //configure with configAdmin
        configure( componentName );
        delay();
        delay();
        //no change
        checkProperties(serviceReference, 8, "anotherValue2", "p1", "p2");

        //check that removing config switches back to defaults modified by config admin
        s.updateProperties(null);
        checkProperties( serviceReference, 8, "theValue", "p1", "p2" );

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here

        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );

        //update theValue
        MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );
        Assert.assertNotNull(s);
        checkProperties( serviceReference, 8, "anotherValue1", "p1", "p2" );
        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        Dictionary d = new Hashtable(Collections.singletonMap( PROP_NAME, "anotherValue" ));
        s.updateProperties(d);
        checkProperties(serviceReference, 5, "anotherValue", "p1", "p2");

        //configure with configAdmin
        configure( componentName );
        delay();
        delay();
        //no change
        checkProperties(serviceReference, 8, "anotherValue2", "p1", "p2");

        //check that removing config switches back to defaults modified by config admin
        s.updateProperties(null);
        checkProperties( serviceReference, 8, "theValue", "p1", "p2" );

        bundleContext.ungetService(serviceReference);
    }
View Full Code Here

        ServiceReference[] serviceReferences = bundleContext.getServiceReferences( MutatingService.class.getName(), "(service.pid=" + componentName + ")" );
        TestCase.assertEquals( 1, serviceReferences.length );
        ServiceReference serviceReference = serviceReferences[0];
        checkProperties( serviceReference, 8, "otherValue", "p1", "p2" );
        MutatingService s = ( MutatingService ) bundleContext.getService( serviceReference );

        SimpleServiceImpl srv1 = SimpleServiceImpl.create( bundleContext, "srv1" );
        checkProperties( serviceReference, 5, null, "p1", "p2" );
        Assert.assertEquals("bound", serviceReference.getProperty("SimpleService"));
View Full Code Here

TOP

Related Classes of org.apache.felix.scr.integration.components.MutatingService

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.