// Wait for the service tracker in the test bundle to register a service with the test result
ServiceReference ref = waitService(String.class.getName(), "(testResult=test1)");
Assert.assertEquals("HiOSGi", ref.getProperty("result"));
} finally {
server.stop();
Thread.currentThread().setContextClassLoader(cl);
}
}
private ServiceReference waitService(String cls, String filter) throws Exception {