assertNotNull("Assert registry not null", registry);
svcListener all = new svcListener();
try {
assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
registry.addServiceListener(all);
ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), null);
try {
assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);