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() );
}