config.update(configProps);
// Register a {@link ManagedService}
Dictionary<String, String> serviceProps = new Hashtable<String, String>();
serviceProps.put(Constants.SERVICE_PID, ConfiguredService.SERVICE_PID);
context.registerService(new String[] { ConfiguredService.class.getName(), ManagedService.class.getName() }, new ConfiguredService(), serviceProps);
// Wait a little for the update event
if (latch.await(5, TimeUnit.SECONDS) == false)
throw new TimeoutException();
// Verify service property
sref = context.getServiceReference(ConfiguredService.class.getName());
ConfiguredService service = (ConfiguredService) context.getService(sref);
assertEquals("bar", service.getValue("foo"));
}
finally
{
config.delete();
}