List<ResourceHandle> handles = new ArrayList<>();
handles.add(provisioner.installSharedResource(builderF.getResource()));
handles.add(provisioner.installResource(builderG.getResource()));
try {
// Verify that the modules got installed
Runtime runtime = RuntimeLocator.getRequiredRuntime();
for (ResourceHandle handle : handles) {
ResourceIdentity identity = handle.getResource().getIdentity();
Assert.assertSame(handle.getModule(), runtime.getModule(identity));
Assert.assertEquals("ACTIVE " + identity, State.ACTIVE, handle.getModule().getState());
}
// Verify that the module activator was called
Module module = runtime.getModule(identityG);
MBeanServer server = ServiceLocator.getRequiredService(MBeanServer.class);
Assert.assertTrue("MBean registered", server.isRegistered(getObjectName(module)));
Assert.assertEquals("ACTIVE", server.getAttribute(getObjectName(module), "ModuleState"));
} finally {
for (ResourceHandle handle : handles) {