@org.junit.Test public void testInstallOptionsRestart() {
final BundleContextMock bc = new BundleContextMock("foo,bar,c,e,f,a", null, "a,b,c|d,e,f");
{
// create first context to simulate install
final SlingSettingsService rm = new SlingSettingsServiceImpl(bc, new StartupHandlerImpl());
assertActive(rm, true, "foo", "bar", "a", "e");
assertActive(rm, false, "b", "c", "d", "f");
}
{
final SlingSettingsService rm = new SlingSettingsServiceImpl(bc, new StartupHandlerImpl(StartupMode.RESTART));
assertActive(rm, true, "foo", "bar", "a", "e");
assertActive(rm, false, "b", "c", "d", "f");
}
// simulate restart with different run modes: new ones that are
// mentioned in the .options properties are ignored
bc.update("foo,doo,a,b,c,d,e,f,waa");
{
final SlingSettingsService rm = new SlingSettingsServiceImpl(bc, new StartupHandlerImpl(StartupMode.RESTART));
assertActive(rm, true, "foo", "doo", "a", "e", "waa");
assertActive(rm, false, "bar", "b", "c", "d", "f");
}
}