use of com.hazelcast.osgi.impl.HazelcastInternalOSGiService in project hazelcast by hazelcast.
the class HazelcastOSGiServiceTest method groupNameIsSetToDefaultGroupNameOfBundleWhenGroupingIsNotDisabled.
@Test
public void groupNameIsSetToDefaultGroupNameOfBundleWhenGroupingIsNotDisabled() {
HazelcastInternalOSGiService service = getService();
HazelcastOSGiInstance osgiInstance = service.newHazelcastInstance();
assertEquals(HazelcastInternalOSGiService.DEFAULT_GROUP_NAME, osgiInstance.getConfig().getGroupConfig().getName());
HazelcastInstance instance = osgiInstance.getDelegatedInstance();
assertEquals(HazelcastInternalOSGiService.DEFAULT_GROUP_NAME, instance.getConfig().getGroupConfig().getName());
}
use of com.hazelcast.osgi.impl.HazelcastInternalOSGiService in project hazelcast by hazelcast.
the class HazelcastOSGiServiceTest method newInstanceRegisteredAsServiceWhenRegistrationIsNotDisabled.
@Test
public void newInstanceRegisteredAsServiceWhenRegistrationIsNotDisabled() throws BundleException {
HazelcastInternalOSGiService service = getService();
service.newHazelcastInstance();
assertNull(bundleContext.getServiceReference(HazelcastOSGiInstance.class.getName()));
}
use of com.hazelcast.osgi.impl.HazelcastInternalOSGiService in project hazelcast by hazelcast.
the class HazelcastOSGiServiceTest method groupNameIsSetToSpecifiedGroupNameWhenGroupingIsNotDisabled.
@Test
public void groupNameIsSetToSpecifiedGroupNameWhenGroupingIsNotDisabled() {
final String GROUP_NAME = "my-osgi-group";
HazelcastInternalOSGiService service = getService();
Config config = new Config();
config.getGroupConfig().setName(GROUP_NAME);
HazelcastOSGiInstance osgiInstance = service.newHazelcastInstance(config);
assertEquals(GROUP_NAME, osgiInstance.getConfig().getGroupConfig().getName());
HazelcastInstance instance = osgiInstance.getDelegatedInstance();
assertEquals(GROUP_NAME, instance.getConfig().getGroupConfig().getName());
}
use of com.hazelcast.osgi.impl.HazelcastInternalOSGiService in project hazelcast by hazelcast.
the class HazelcastOSGiServiceTest method allInstancesShutdownSuccessfully.
@Test
public void allInstancesShutdownSuccessfully() {
Set<HazelcastOSGiInstance> osgiInstances = new HashSet<HazelcastOSGiInstance>();
HazelcastInternalOSGiService service = getService();
osgiInstances.add(service.newHazelcastInstance());
osgiInstances.add(service.newHazelcastInstance(new Config("test-osgi-instance")));
Set<HazelcastOSGiInstance> allOSGiInstances = service.getAllHazelcastInstances();
for (HazelcastOSGiInstance osgiInstance : allOSGiInstances) {
assertTrue(osgiInstance.getLifecycleService().isRunning());
HazelcastInstance instance = osgiInstance.getDelegatedInstance();
assertTrue(instance.getLifecycleService().isRunning());
}
service.shutdownAll();
for (HazelcastOSGiInstance osgiInstance : osgiInstances) {
assertFalse(osgiInstance.getLifecycleService().isRunning());
HazelcastInstance instance = osgiInstance.getDelegatedInstance();
assertFalse(instance.getLifecycleService().isRunning());
}
allOSGiInstances = service.getAllHazelcastInstances();
assertEquals(0, allOSGiInstances.size());
}
use of com.hazelcast.osgi.impl.HazelcastInternalOSGiService in project hazelcast by hazelcast.
the class HazelcastOSGiServiceTest method allInstancesRetrievedSuccessfully.
@Test
public void allInstancesRetrievedSuccessfully() {
Set<HazelcastOSGiInstance> osgiInstances = new HashSet<HazelcastOSGiInstance>();
HazelcastInternalOSGiService service = getService();
osgiInstances.add(service.newHazelcastInstance());
osgiInstances.add(service.newHazelcastInstance(new Config("test-osgi-instance")));
Set<HazelcastOSGiInstance> allOSGiInstances = service.getAllHazelcastInstances();
assertEquals(osgiInstances.size(), allOSGiInstances.size());
assertContainsAll(allOSGiInstances, osgiInstances);
}
Aggregations