public void testComplexContextQuiesce() throws Exception {
//This is load bearing. we have to wait to create the EntityManager until the DataSource is available
getOsgiService(DataSource.class);
// Get a managed context registered
PersistenceContextProvider provider = getOsgiService(PersistenceContextProvider.class);
HashMap<String, Object> props = new HashMap<String, Object>();
props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
provider.registerContext("test-unit", bundleContext.getBundle(), props);
EntityManagerFactory emf = getOsgiService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
+ PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
"(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))", DEFAULT_TIMEOUT);