final String locationA = bundleA.getLocation();
bundleA.start();
delay();
// call back with null
final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
TestCase.assertNull( tester.props );
TestCase.assertEquals( 1, tester.numManagedServiceUpdatedCalls );
// 2. create new Conf with pid1 and locationA.
final Configuration config = configure( pid, locationA, false );
delay();
// ==> No call back.
TestCase.assertNull( tester.props );
TestCase.assertEquals( 1, tester.numManagedServiceUpdatedCalls );
// 3. Configuration#update(prop) is called.
config.update( theConfig );
delay();
// ==> call back with the prop.
TestCase.assertNotNull( tester.props );
TestCase.assertEquals( 2, tester.numManagedServiceUpdatedCalls );
// 4. Stop BundleA
bundleA.stop();
delay();
// 5. Start BundleA
bundleA.start();
delay();
// ==> call back with the prop.
final ManagedServiceTestActivator tester2 = ManagedServiceTestActivator.INSTANCE;
TestCase.assertNotNull( tester2.props );
TestCase.assertEquals( 1, tester2.numManagedServiceUpdatedCalls );
// 6. Configuration#deleted() is called.
config.delete();
delay();
// ==> call back with null.
TestCase.assertNull( tester2.props );
TestCase.assertEquals( 2, tester2.numManagedServiceUpdatedCalls );
// 7. uninstall Bundle A for cleanup.
bundleA.uninstall();
delay();
// Test 2
// 8. BundleA registers ManagedService with pid1.
final Bundle bundleA2 = installBundle( pid, ManagedServiceTestActivator.class );
final String locationA2 = bundleA.getLocation();
bundleA2.start();
delay();
// call back with null
final ManagedServiceTestActivator tester21 = ManagedServiceTestActivator.INSTANCE;
TestCase.assertNull( tester21.props );
TestCase.assertEquals( 1, tester21.numManagedServiceUpdatedCalls );
// 9. create new Conf with pid1 and locationB.
final String locationB = "test:locationB/" + pid;