bundle = installBundle( factoryPid0 + "," + factoryPid1, ManagedServiceFactoryTestActivator.class );
bundle.start();
delay();
// pid0 properties provided on registration
final ManagedServiceFactoryTestActivator tester = ManagedServiceFactoryTestActivator.INSTANCE;
Dictionary<?, ?> props0 = tester.configs.get( pid0 );
TestCase.assertNotNull( props0 );
TestCase.assertEquals( pid0, props0.get( Constants.SERVICE_PID ) );
TestCase.assertEquals( factoryPid0, props0.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
TestCase.assertNull( props0.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
TestCase.assertEquals( PROP_NAME, props0.get( PROP_NAME ) );
Dictionary<?, ?> props1 = tester.configs.get( pid1 );
TestCase.assertNotNull( props1 );
TestCase.assertEquals( pid1, props1.get( Constants.SERVICE_PID ) );
TestCase.assertEquals( factoryPid1, props1.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
TestCase.assertNull( props1.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
TestCase.assertEquals( PROP_NAME, props1.get( PROP_NAME ) );
TestCase.assertEquals( 0, tester.numManagedServiceUpdatedCalls );
TestCase.assertEquals( 2, tester.numManagedServiceFactoryUpdatedCalls );
TestCase.assertEquals( 0, tester.numManagedServiceFactoryDeleteCalls );
// change ManagedService PID
tester.changePid( factoryPid1 + "," + factoryPid2 );
delay();
// pid2 properties must have been added
Dictionary<?, ?> props2 = tester.configs.get( pid2 );
TestCase.assertNotNull( props2 );