Bundle smxJsr181 = installJbiBundle("org.apache.servicemix", "servicemix-jsr181", "installer", "zip");
Bundle smxHttp = installJbiBundle("org.apache.servicemix", "servicemix-http", "installer", "zip");
Bundle saBundle = installJbiBundle("org.apache.servicemix.samples.wsdl-first", "wsdl-first-sa", null, "zip");
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());
}