// a basic latch isn't ideal here, as there are 2 apps to deploy
assertTrue("Deployer never invoked", deployLatch.await(LATCH_TIMEOUT, TimeUnit.MILLISECONDS));
assertAppsDir(NONE, new String[] {"dummy-app", "priviledged-dummy-app"}, true);
final Application privApp = findApp("priviledged-dummy-app", 2);
final Application dummyApp = findApp("dummy-app", 2);
assertTrue(((ApplicationWrapper) privApp).getDelegate() instanceof PriviledgedMuleApplication);
final MuleContext muleContext1 = privApp.getMuleContext();
System.out.println("muleContext1 = " + muleContext1);
assertNotSame(muleContext1, muleContext);
assertNotSame(privApp.getDeploymentClassLoader(), dummyApp.getDeploymentClassLoader());
final Collection<FlowConstruct> flowConstructs = dummyApp.getMuleContext().getRegistry().lookupObjects(FlowConstruct.class);
assertFalse("No FlowConstructs found in the sibling app", flowConstructs.isEmpty());
FlowConstruct fc = flowConstructs.iterator().next();
assertTrue(fc instanceof SimpleService);
SimpleService service = (SimpleService) fc;
// note that we don't have this class available to this test directly