/* * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
publicclass i18n { privatestaticfinal String[][] TABLE = new String[][]{
{"-help", "All the output in this test should be in ${LANG}. "
+ "Otherwise, the test failed."},
{"-genkeypair -keyalg DSA -v -keysize 512 "
+ "-dname cn=Name,ou=Java,o=Oracle,l=City,s=State,c=Country "
+ "-storepass a "
+ "-keypass a "
+ "-keystore ./i18n.keystore", "Output in ${LANG}. Check keytool error: java.lang.Exception: "
+ "Keystore password must be at least 6 characters."},
{"-storepasswd "
+ "-storepass password "
+ "-new a "
+ "-keystore ./i18n.keystore", "Output in ${LANG}. Check keytool error: java.lang.Exception: "
+ "New password must be at least 6 characters."},
{"-storepasswd "
+ "-storetype PKCS11 "
+ "-keystore NONE", "Output in ${LANG}. Check keytool error: java.lang"
+ ".UnsupportedOperationException: -storepasswd and "
+ "-keypasswd commands not supported if -storetype is"
+ " PKCS11."},
{"-keypasswd "
+ "-storetype PKCS11 "
+ "-keystore NONE", "Output in ${LANG}. Check keytool error: java.lang"
+ ".UnsupportedOperationException: -storepasswd and "
+ "-keypasswd commands not supported if -storetype is"
+ " PKCS11."},
{"-list -protected "
+ "-storepass password "
+ "-keystore ./i18n.keystore", "Output in ${LANG}. Check keytool error: java.lang"
+ ".IllegalArgumentException: if -protected is "
+ "specified, then -storepass, -keypass, and -new "
+ "must not be specified."},
{"-keypasswd -protected "
+ "-storepass password "
+ "-keystore ./i18n.keystore", "Output in ${LANG}. Check keytool error: java.lang"
+ ".IllegalArgumentException: if -protected is "
+ "specified, then -storepass, -keypass, and -new "
+ "must not be specified."},
{"-keypasswd -protected "
+ "-storepass password "
+ "-new aaaaaa "
+ "-keystore ./i18n.keystore", "Output in ${LANG}. Check keytool error: java.lang"
+ ".IllegalArgumentException: if -protected is "
+ "specified, then -storepass, -keypass, and -new "
+ "must not be specified."},
}; privatestatic String TEST_SRC = System.getProperty("test.src"); privatestaticint TIMEOUT_MS = 120000; privatevolatileboolean failed = false; privatevolatileboolean aborted = false; privateThread currentThread = null;
publicstaticvoid main(String[] args) { final String lang = System.getProperty("user.language"); final String country = System.getProperty("user.country");
if (lang != null) { if (country != null) {
Locale.setDefault(Locale.of(lang, country));
} else {
Locale.setDefault(Locale.of(lang));
}
}
final String displayName = Locale.getDefault().getDisplayName();
boolean testFailed = false;
i18n i18nTest = new i18n();
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 ist noch experimentell.