2362N/A * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @bug 5102289 6278334 0N/A * @summary Test the default Control implementation. The expiration 0N/A * functionality of newBundle, getTimeToLive, and needsReload is 0N/A * tested by ExpirationTest.sh. The factory methods are tested 0N/A * @build TestResourceRB 0N/A * @build NonResourceBundle 0N/A * @run main DefaultControlTest 0N/A // The ResourceBundle.Control instance 0N/A // Full arguments for NPE testing 0N/A // Test getFormats(String) 0N/A // Test getCandidateLocales(String, Locale) 0N/A // Test getFallbackLocale(String, Locale) 0N/A // Test newBundle(String, Locale, String, ClassLoader, boolean) 0N/A // Test toBundleName(String, Locale) 0N/A // Test getTimeToLive(String, Locale) 0N/A // Test needsReload(String, Locale, String, ClassLoader, 0N/A // ResourceBundle, long) 0N/A // Test toResourceName(String, String) 0N/A error(
"Wrong Control.FORMAT_PROPERTIES");
0N/A error(
"Wrong Control.TTL_NO_EXPIRATION_CONTROL: %d%n",
0N/A error(
"Wrong candidates for %s: got %s, expected %s%n",
0N/A error(
"getCandidateLocales(%s, %s) doesn't throw NPE.%n",
0N/A error(
"getFallbackLocale: got %s, expected %s%n",
0N/A // MalformedDataRB contains an invalid Unicode notation which 0N/A // causes to throw an IllegalArgumentException. 0N/A error(
"newBundle: doesn't throw IllegalArgumentException with malformed data.");
0N/A error(
"newBundle: doesn't throw IllegalArgumentException with invalid format.");
0N/A error(
"newBundle: doesn't throw ClassCastException with a non-ResourceBundle subclass.");
0N/A error(
"newBundle(%s, %s, %s, %s, false) doesn't throw NPE.%n",
0N/A error(
"newBundle(%s, %s, %s, %s, false) threw %s.%n",
0N/A // The functionality of needsReload is tested by 0N/A // ExpirationTest.sh. Only parameter checking is tested here. 0N/A error(
"needsReload(%s, %s, %s, %s, %s, loadTime) doesn't throw NPE.%n",
0N/A name +
"_" +
"ja" +
"_" +
"JP" +
"_" +
"YOK");
0N/A name +
"_" +
"ja" +
"_" +
"" +
"_" +
"YOK");
0N/A name +
"_" +
"" +
"_" +
"JP" +
"_" +
"YOK");
0N/A name +
"_" +
"" +
"_" +
"" +
"_" +
"YOK");
0N/A // bundleName, suffix, expected result 0N/A // data for NPE tests 0N/A * Produces permutations argument data that contains at least one