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

Examples of org.apache.felix.scr.integration.components.circular.A


        Object service = bundleContext.getService( serviceReference );
        assertNotNull( service );

        delay();

        A a = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a.getBs().size() );
        B b = ( B ) componentB.getComponentInstance().getInstance();
        assertEquals( 1, b.getAs().size() );
    }
View Full Code Here


        ServiceReference serviceReferenceA = serviceReferencesA[0];
        Object serviceA = bundleContext.getService( serviceReferenceA );
        assertNotNull( serviceA );

        delay();
        A a = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a.getBs().size() );
        B b = ( B ) componentB.getComponentInstance().getInstance();
        assertEquals( 1, b.getAs().size() );


        //disabling (removing the A service registration) and re-enabling will
        //result in a service event to B, so B will bind A.
        componentA.disable();
        delay();
        componentA.enable();
        delay();
        ServiceReference[] serviceReferencesA1 = bundleContext.getServiceReferences( A.class.getName(), "(service.pid=" + componentNameA + ")" );
        TestCase.assertEquals( 1, serviceReferencesA1.length );
        ServiceReference serviceReferenceA1 = serviceReferencesA1[0];
        Object serviceA1 = bundleContext.getService( serviceReferenceA1 );
        assertNotNull( serviceA1 );

        A a1 = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a1.getBs().size() );
        B b1 = ( B ) componentB.getComponentInstance().getInstance();
        assertEquals( 1, b1.getAs().size() );

    }
View Full Code Here

    {
        String componentNameA = "5.A.1.1.dynamic";
        final Component componentA = findComponentByName( componentNameA );
        TestCase.assertNotNull( componentA );
        TestCase.assertEquals( Component.STATE_ACTIVE, componentA.getState() );
        A a = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a.getBs().size());

        String componentNameB = "5.B.0.1.dynamic";
        final Component componentB = findComponentByName( componentNameB );
        TestCase.assertNotNull( componentB );
        TestCase.assertEquals( Component.STATE_ACTIVE, componentB.getState() );
View Full Code Here

    {
        String componentNameA = "6.A.1.1.dynamic";
        final Component componentA = findComponentByName( componentNameA );
        TestCase.assertNotNull( componentA );
        TestCase.assertEquals( Component.STATE_ACTIVE, componentA.getState() );
        A a = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a.getBs().size());

        String componentNameB = "6.B.0.1.dynamic";
        final Component componentB = findComponentByName( componentNameB );
        TestCase.assertNotNull( componentB );
        TestCase.assertEquals( Component.STATE_ACTIVE, componentB.getState() );
View Full Code Here

        ServiceReference serviceReference = serviceReferences[0];
        Object service = bundleContext.getService( serviceReference );
        assertNotNull( service );

        delay();
        A a = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a.getBs().size() );
        B b = ( B ) componentB.getComponentInstance().getInstance();
        assertEquals( 1, b.getAs().size() );
    }
View Full Code Here

        Object serviceA = bundleContext.getService( serviceReferenceA );
        assertNotNull( serviceA );


        delay();
        A a = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a.getBs().size() );
        B b = ( B ) componentB.getComponentInstance().getInstance();
        assertEquals( 1, b.getAs().size() );


        //disabling (removing the A service registration) and re-enabling will
        //result in a service event to B, so B will bind A.
        componentA.disable();
        delay();
        componentA.enable();
        delay();
        ServiceReference[] serviceReferencesA1 = bundleContext.getServiceReferences( A.class.getName(), "(service.pid=" + componentNameA + ")" );
        TestCase.assertEquals( 1, serviceReferencesA1.length );
        ServiceReference serviceReferenceA1 = serviceReferencesA1[0];
        Object serviceA1 = bundleContext.getService( serviceReferenceA1 );
        assertNotNull( serviceA1 );

        A a1 = ( A ) componentA.getComponentInstance().getInstance();
        assertEquals( 1, a1.getBs().size() );
        B b1 = ( B ) componentB.getComponentInstance().getInstance();
        assertEquals( 1, b1.getAs().size() );

    }
View Full Code Here

TOP

Related Classes of org.apache.felix.scr.integration.components.circular.A

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.