// Perform the action in doAs() or callAs() and inspect // the exception (and its causes, recursively) it throws private TestCase test(boolean doAs, Class<?>... exceptions) { int pos = 0; try { if (doAs) {
Subject.doAs(null, (PrivilegedExceptionAction<Object>) action::call);
} else {
Subject.callAs(null, action::call);
}
} catch (Exception e) { while (e != null) {
Asserts.assertEQ(e.getClass(), exceptions[pos++]);
e = (Exception) e.getCause();
}
} // Make sure the list is the exact size
Asserts.assertTrue(pos == exceptions.length); returnthis;
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.