CallbackHandler handler = new Helper.UserPasswordHandler(
USER, USER_PASSWORD);
// create a krb5 config with non-existing host for primary KDC, // and wrong port for replica KDC try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
w.write(String.format(KRB5_CONF_TEMPLATE,
KDC.NOT_EXISTING_HOST, WRONG_KDC_PORT));
w.flush();
}
// login with not-refreshable config try { new LoginContext("NotRefreshable", handler).login(); thrownew RuntimeException("Expected exception not thrown");
} catch (LoginException le) {
System.out.println("Expected login failure: " + le);
}
// create a krb5 config with non-existing host for primary KDC, // but correct port for replica KDC try (PrintWriter w = new PrintWriter(new FileWriter(KRB5_CONF))) {
w.write(String.format(KRB5_CONF_TEMPLATE,
KDC.NOT_EXISTING_HOST, kdc.getPort()));
w.flush();
}
// login with not-refreshable config try { new LoginContext("NotRefreshable", handler).login(); thrownew RuntimeException("Expected exception not thrown");
} catch (LoginException le) {
System.out.println("Expected login failure: " + le);
}
// login with refreshable config new LoginContext("Refreshable", handler).login();
System.out.println("Test passed");
}
}
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.