smxJsr181.start();
smxHttp.start();
saBundle.start();
System.out.println("Waiting for JBI Service Assembly");
ServiceAssembly sa = getOsgiService(ServiceAssembly.class);
assertNotNull(sa);
assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());
saBundle.stop();
saBundle.start();
sa = getOsgiService(ServiceAssembly.class);
assertNotNull(sa);
assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());
saBundle.update();
sa = getOsgiService(ServiceAssembly.class);
assertNotNull(sa);
assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());
smxHttp.stop();
try {
getOsgiService(ServiceAssembly.class, 1);
fail("ServiceAssembly OSGi service should have been unregistered");
} catch (RuntimeException e) {
// Ignore
}
smxHttp.start();
sa = getOsgiService(ServiceAssembly.class);
assertNotNull(sa);
assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());
smxHttp.stop();
smxJsr181.stop();
smxShared.stop();
}