assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
Properties props = new Properties();
props.put("foo", "bar");
ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
ServiceReference ref = registry.getServiceReference(BarService.class.getName());
assertNotNull("Check ref not null", ref);
assertEquals("Test property", ref.getProperty("foo"), "bar");
BarService bar = (BarService) registry.getService(im2, ref);