{
Throwable problem = ctx.getProblem();
if (e != null || expected != null)
{
if (expected != null && problem == null)
throw new AssertionFailedError("Did not get expected " + expected.getName() + " for " + ctx);
if (expected == null && problem != null)
{
if (problem instanceof Exception)
throw (Exception) problem;
if (problem instanceof Error)
throw (Error) problem;
throw new UndeclaredThrowableException(problem);
}
if (expected != null)
{
AbstractSystemTest.checkThrowableDeep(expected, problem);
if (ServiceContext.FAILED != ctx.state)
throw new AssertionFailedError("Context is not in the FAILED state: " + ctx);
}
}
return;
}
}
throw new AssertionFailedError("Did not find " + name + " in incomplete deployments " + incomplete);
}