for(ControllerState whenRequired : getStateModel())
{
ControllerContext context = createControllerContext(method.getName());
DependencyInfo info = context.getDependencyInfo();
info.addDependsOnMe(ProxyDependencyItem.createDependencyInfo(method, i, whenRequired));
DependencyItem beanDependency = new AbstractDependencyItem("bean", context.getName(), whenRequired, null);
bean.getDependencyInfo().addIDependOn(beanDependency);
ControllerState previous = getStateModel().getPreviousState(whenRequired);
if (previous == null)
previous = ControllerState.INSTALLED;
install(bean);
assertEquals(previous, bean.getState());
install(context);
ControllerState state = context.getState();
assertTrue(context.getName().toString(), ControllerState.ERROR.equals(state) || ControllerState.INSTALLED.equals(state));
if (ControllerState.INSTALLED.equals(state))
assertEquals(ControllerState.INSTALLED, bean.getState());
else
assertEquals(previous, bean.getState());
uninstall(context);
if (beanDependency.isResolved())
{
Throwable t = context.getError();
if (t != null)
{
StackTraceElement[] elements = t.getStackTrace();