{
// 1. create config with pid and locationA
// 2. update config with properties
final String pid = "pid with blanks and stuff %\"'";
theConfig.put( pid, pid );
final Configuration config = configure( pid, null, true );
theConfig.remove( pid );
// 3. register ManagedService ms1 with pid from said locationA
bundle = installBundle( pid, ManagedServiceTestActivator.class );
bundle.start();
delay();
// ==> configuration supplied to the service ms1
final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
TestCase.assertNotNull( tester.props );
TestCase.assertEquals( pid, tester.props.get( Constants.SERVICE_PID ) );
TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_FACTORYPID ) );
TestCase.assertNull( tester.props.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) );
TestCase.assertEquals( PROP_NAME, tester.props.get( PROP_NAME ) );
TestCase.assertEquals( pid, tester.props.get( pid ) );
TestCase.assertEquals( 1, tester.numManagedServiceUpdatedCalls );
// delete
config.delete();
delay();
// ==> update with null
TestCase.assertNull( tester.props );
TestCase.assertEquals( 2, tester.numManagedServiceUpdatedCalls );