public void testDemandDependencyReinstall() throws Throwable
{
demandDependencyReinstall();
ControllerContext context1 = assertInstall(0, "Name1");
ControllerContext context2 = assertInstall(1, "Name2");
SimpleBean bean1 = (SimpleBean) context1.getTarget();
assertNotNull(bean1);
assertEquals("String1", bean1.getString());
SimpleBean bean2 = (SimpleBean) context2.getTarget();
assertNotNull(bean2);
assertEquals("String2", bean2.getString());
assertUninstall("Name1");
assertEquals(ControllerState.ERROR, context1.getState());
assertEquals(ControllerState.NOT_INSTALLED, context2.getState());
assertNotInstalled("Name2");
assertContext("Name2", ControllerState.NOT_INSTALLED);
context1 = assertInstall(0, "Name1");
assertNotNull(context1);
assertEquals(ControllerState.INSTALLED, context2.getState());
bean1 = (SimpleBean) context1.getTarget();
assertNotNull(bean1);
assertEquals("String1", bean1.getString());
bean2 = (SimpleBean) context2.getTarget();
assertNotNull(bean2);
assertEquals("String2", bean2.getString());
assertUninstall("Name2");
assertEquals(ControllerState.INSTALLED, context1.getState());
assertEquals(ControllerState.ERROR, context2.getState());
bean1 = (SimpleBean) context1.getTarget();
assertNotNull(bean1);
assertEquals("String1", bean1.getString());
context2 = assertInstall(1, "Name2");
bean1 = (SimpleBean) context1.getTarget();
assertNotNull(bean1);
assertEquals("String1", bean1.getString());
bean2 = (SimpleBean) context2.getTarget();
assertNotNull(bean2);
assertEquals("String2", bean2.getString());
}