String pid = "test_start_bundle_configure_stop_start_bundle";
// start the bundle and assert this
bundle = installBundle( pid );
bundle.start();
final ManagedServiceTestActivator tester = ManagedServiceTestActivator.INSTANCE;
TestCase.assertNotNull( "Activator not started !!", tester );
// give cm time for distribution
delay();
// assert activater has no configuration
TestCase.assertNull( "Expect no Properties after Service Registration", tester.props );
TestCase.assertEquals( "Expect update call", 1, tester.numManagedServiceUpdatedCalls );
// configure after ManagedServiceRegistration --> configure via update
configure( pid );
delay();
// assert activater has configuration
TestCase.assertNotNull( "Expect Properties after Service Registration", tester.props );
TestCase.assertEquals( "Expect a second update call", 2, tester.numManagedServiceUpdatedCalls );
// stop the bundle now
bundle.stop();
// assert INSTANCE is null
TestCase.assertNull( ManagedServiceTestActivator.INSTANCE );
delay();
// start the bundle again (and check)
bundle.start();
final ManagedServiceTestActivator tester2 = ManagedServiceTestActivator.INSTANCE;
TestCase.assertNotNull( "Activator not started the second time!!", tester2 );
TestCase.assertNotSame( "Instances must not be the same", tester, tester2 );
// give cm time for distribution
delay();