diff --git a/test/jdk/java/util/Locale/Bug8179071.java b/test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java similarity index 96% rename from test/jdk/java/util/Locale/Bug8179071.java rename to test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java index 97e6b0118a3..fa41aeea07c 100644 --- a/test/jdk/java/util/Locale/Bug8179071.java +++ b/test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java @@ -26,7 +26,7 @@ * @bug 8179071 8202537 8231273 8251317 * @summary Test that language aliases of CLDR supplemental metadata are handled correctly. * @modules jdk.localedata - * @run junit/othervm -Djava.locale.providers=CLDR Bug8179071 + * @run junit/othervm -Djava.locale.providers=CLDR AliasesShouldBeRecognizedInCLDR */ /* @@ -49,7 +49,7 @@ import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -public class Bug8179071 { +public class AliasesShouldBeRecognizedInCLDR { /* * Deprecated and Legacy tags. diff --git a/test/jdk/java/util/Locale/Bug4518797.java b/test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java similarity index 90% rename from test/jdk/java/util/Locale/Bug4518797.java rename to test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java index 5f65b2b0639..70f6f44d36a 100644 --- a/test/jdk/java/util/Locale/Bug4518797.java +++ b/test/jdk/java/util/Locale/HashCodeShouldBeThreadSafe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -24,14 +24,18 @@ * @test * @bug 4518797 * @summary Make sure that hashCode() and read/writeObject() are thread-safe. - * @run main Bug4518797 10 + * @run main HashCodeShouldBeThreadSafe 10 */ -import java.util.*; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Locale; -// Usage: java Bug4518797 [duration] -public class Bug4518797 { +// Usage: java HashCodeShouldBeThreadSafe [duration] +public class HashCodeShouldBeThreadSafe { static volatile boolean runrun = true; static volatile String message = null; diff --git a/test/jdk/java/util/Locale/Bug4184873Test.java b/test/jdk/java/util/Locale/LegacyCodesClassInvariant.java similarity index 90% rename from test/jdk/java/util/Locale/Bug4184873Test.java rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant.java index 817881000f2..c19a74516a0 100644 --- a/test/jdk/java/util/Locale/Bug4184873Test.java +++ b/test/jdk/java/util/Locale/LegacyCodesClassInvariant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -22,10 +22,10 @@ */ /* @test + @bug 4184873 @summary test that locale invariants are preserved across serialization @library /java/text/testlib - @run main Bug4184873Test - @bug 4184873 + @run main LegacyCodesClassInvariant */ /* * This file is available under and governed by the GNU General Public @@ -61,18 +61,22 @@ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ -import java.util.*; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Locale; /** * A Locale can never contain the following language codes: he, yi or id. */ -public class Bug4184873Test extends IntlTest { +public class LegacyCodesClassInvariant extends IntlTest { public static void main(String[] args) throws Exception { if (args.length == 1 && args[0].equals("prepTest")) { prepTest(); } else { - new Bug4184873Test().run(args); + new LegacyCodesClassInvariant().run(args); } } @@ -104,7 +108,7 @@ public class Bug4184873Test extends IntlTest { private ObjectInputStream getStream(String lang) { try { - final File f = new File(System.getProperty("test.src", "."), "Bug4184873_"+lang); + final File f = new File(System.getProperty("test.src", "."), "LegacyCodesClassInvariant_"+lang); return new ObjectInputStream(new FileInputStream(f)); } catch (Exception e) { errln(e.toString()); @@ -125,7 +129,7 @@ public class Bug4184873Test extends IntlTest { private static void outputLocale(String lang) { try { ObjectOutputStream out = new ObjectOutputStream( - new FileOutputStream("Bug4184873_"+lang)); + new FileOutputStream("LegacyCodesClassInvariant_"+lang)); out.writeObject(Locale.of(lang, "XX")); out.close(); } catch (Exception e) { diff --git a/test/jdk/java/util/Locale/Bug4184873_he b/test/jdk/java/util/Locale/LegacyCodesClassInvariant_he similarity index 100% rename from test/jdk/java/util/Locale/Bug4184873_he rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant_he diff --git a/test/jdk/java/util/Locale/Bug4184873_id b/test/jdk/java/util/Locale/LegacyCodesClassInvariant_id similarity index 100% rename from test/jdk/java/util/Locale/Bug4184873_id rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant_id diff --git a/test/jdk/java/util/Locale/Bug4184873_yi b/test/jdk/java/util/Locale/LegacyCodesClassInvariant_yi similarity index 100% rename from test/jdk/java/util/Locale/Bug4184873_yi rename to test/jdk/java/util/Locale/LegacyCodesClassInvariant_yi diff --git a/test/jdk/java/util/Locale/Bug7069824.java b/test/jdk/java/util/Locale/LocaleMatchingTest.java similarity index 98% rename from test/jdk/java/util/Locale/Bug7069824.java rename to test/jdk/java/util/Locale/LocaleMatchingTest.java index 905cde17d50..975e4567e18 100644 --- a/test/jdk/java/util/Locale/Bug7069824.java +++ b/test/jdk/java/util/Locale/LocaleMatchingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2023, 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 @@ -25,11 +25,19 @@ * @test * @bug 7069824 8042360 8032842 8175539 8210443 8242010 8276302 * @summary Verify implementation for Locale matching. - * @run testng/othervm Bug7069824 + * @run testng/othervm LocaleMatchingTest */ -import java.util.*; -import java.util.Locale.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Locale.FilteringMode; +import java.util.Locale.LanguageRange; +import java.util.Map; + import static java.util.Locale.FilteringMode.*; import static java.util.Locale.LanguageRange.*; import static org.testng.Assert.*; @@ -37,7 +45,7 @@ import static org.testng.Assert.*; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -public class Bug7069824 { +public class LocaleMatchingTest { @DataProvider(name = "LRConstructorData") Object[][] LRConstructorData() { diff --git a/test/jdk/java/util/Locale/Bug4152725.java b/test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java similarity index 87% rename from test/jdk/java/util/Locale/Bug4152725.java rename to test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java index 54392de239a..18432eecd07 100644 --- a/test/jdk/java/util/Locale/Bug4152725.java +++ b/test/jdk/java/util/Locale/LocaleShouldSetFromCLI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2023, 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 @@ -26,24 +26,24 @@ * @summary Verify that the default locale can be specified from the * command line. * @run main/othervm -Duser.language=de -Duser.country=DE -Duser.variant=EURO - * Bug4152725 de_DE_EURO + * LocaleShouldSetFromCLI de_DE_EURO * @run main/othervm -Duser.language=ja -Duser.country= -Duser.variant= - * Bug4152725 ja + * LocaleShouldSetFromCLI ja * @run main/othervm -Duser.language=en -Duser.country=SG -Duser.variant= - * Bug4152725 en_SG + * LocaleShouldSetFromCLI en_SG * @run main/othervm -Duser.language= -Duser.country=DE -Duser.variant=EURO - * Bug4152725 _DE_EURO + * LocaleShouldSetFromCLI _DE_EURO * @run main/othervm -Duser.language=ja -Duser.country= -Duser.variant=YOMI - * Bug4152725 ja__YOMI + * LocaleShouldSetFromCLI ja__YOMI * @run main/othervm -Duser.language= -Duser.country= -Duser.variant=EURO - * Bug4152725 __EURO + * LocaleShouldSetFromCLI __EURO * @run main/othervm -Duser.language=de -Duser.region=DE_EURO - * Bug4152725 de_DE_EURO + * LocaleShouldSetFromCLI de_DE_EURO */ import java.util.Locale; -public class Bug4152725 { +public class LocaleShouldSetFromCLI { public static void main(String[] args) { diff --git a/test/jdk/java/util/Locale/Bug8135061.java b/test/jdk/java/util/Locale/LookupOnValidRangeTest.java similarity index 97% rename from test/jdk/java/util/Locale/Bug8135061.java rename to test/jdk/java/util/Locale/LookupOnValidRangeTest.java index 0e59a9ecbd9..cbf889f0428 100644 --- a/test/jdk/java/util/Locale/Bug8135061.java +++ b/test/jdk/java/util/Locale/LookupOnValidRangeTest.java @@ -26,7 +26,7 @@ * @bug 8135061 * @summary Checks that the Locale.lookup executes properly without throwing * any exception for some specific language ranges - * @run junit Bug8135061 + * @run junit LookupOnValidRangeTest */ import java.util.Collection; @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -public class Bug8135061 { +public class LookupOnValidRangeTest { /** * Lookup should run without throwing any exception and return null as diff --git a/test/jdk/java/util/Locale/Bug8035133.java b/test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java similarity index 98% rename from test/jdk/java/util/Locale/Bug8035133.java rename to test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java index f5f532e3cc6..f69873b566c 100644 --- a/test/jdk/java/util/Locale/Bug8035133.java +++ b/test/jdk/java/util/Locale/MatchEmptyWeightCorrectly.java @@ -25,7 +25,7 @@ * @bug 8035133 * @summary Checks that the tags matching the range with quality weight q=0 * e.g. en;q=0 must be elimited and must not be the part of output - * @run junit Bug8035133 + * @run junit MatchEmptyWeightCorrectly */ import java.util.ArrayList; @@ -40,7 +40,7 @@ import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.assertEquals; -public class Bug8035133 { +public class MatchEmptyWeightCorrectly { // Ensure weights with 'q=0' work as expected during lookup @ParameterizedTest diff --git a/test/jdk/java/util/Locale/Bug6989440.java b/test/jdk/java/util/Locale/ProviderPoolMultiThreadAccess.java similarity index 94% rename from test/jdk/java/util/Locale/Bug6989440.java rename to test/jdk/java/util/Locale/ProviderPoolMultiThreadAccess.java index 9dfb911e859..7acca68b1df 100644 --- a/test/jdk/java/util/Locale/Bug6989440.java +++ b/test/jdk/java/util/Locale/ProviderPoolMultiThreadAccess.java @@ -27,8 +27,8 @@ * @summary Verify ConcurrentModificationException is not thrown with multiple * thread accesses. * @modules java.base/sun.util.locale.provider - * @compile -XDignore.symbol.file=true Bug6989440.java - * @run junit Bug6989440 + * @compile -XDignore.symbol.file=true ProviderPoolMultiThreadAccess.java + * @run junit ProviderPoolMultiThreadAccess */ import java.text.spi.DateFormatProvider; import java.util.spi.LocaleNameProvider; @@ -39,7 +39,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; import org.junit.jupiter.api.Test; -public class Bug6989440 { +public class ProviderPoolMultiThreadAccess { static volatile boolean failed; // false static final int THREADS = 50; diff --git a/test/jdk/java/util/Locale/Bug8166994.java b/test/jdk/java/util/Locale/SubsequentRangeParsingTest.java similarity index 96% rename from test/jdk/java/util/Locale/Bug8166994.java rename to test/jdk/java/util/Locale/SubsequentRangeParsingTest.java index e39627ac709..b160b3a692e 100644 --- a/test/jdk/java/util/Locale/Bug8166994.java +++ b/test/jdk/java/util/Locale/SubsequentRangeParsingTest.java @@ -23,12 +23,12 @@ /* * @test - * @bug 8166884 + * @bug 8166994 * @summary Checks the subsequent call to parse the same language ranges * which must generate the same list of language ranges * i.e. the priority list containing equivalents, as in the * first call - * @run junit Bug8166994 + * @run junit SubsequentRangeParsingTest */ import java.util.Arrays; @@ -43,7 +43,7 @@ import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.assertEquals; -public class Bug8166994 { +public class SubsequentRangeParsingTest { /* * Checks that consecutive calls to parse the same language ranges diff --git a/test/jdk/java/util/Locale/Bug8159420.java b/test/jdk/java/util/Locale/TurkishLangRangeTest.java similarity index 97% rename from test/jdk/java/util/Locale/Bug8159420.java rename to test/jdk/java/util/Locale/TurkishLangRangeTest.java index 2e6de243b36..44366bbc0d0 100644 --- a/test/jdk/java/util/Locale/Bug8159420.java +++ b/test/jdk/java/util/Locale/TurkishLangRangeTest.java @@ -31,8 +31,8 @@ * e.g. "HI-Deva".toLowerCase() in the Turkish locale returns * "hı-deva", where 'ı' is the LATIN SMALL LETTER DOTLESS I character * which is not allowed in the language ranges/tags. - * @compile -encoding utf-8 Bug8159420.java - * @run junit/othervm -Duser.language=tr -Duser.country=TR Bug8159420 + * @compile -encoding utf-8 TurkishLangRangeTest.java + * @run junit/othervm -Duser.language=tr -Duser.country=TR TurkishLangRangeTest */ import java.util.ArrayList; @@ -58,7 +58,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public class Bug8159420 { +public class TurkishLangRangeTest { /* * Ensure parse() does not throw IllegalArgumentException for the Turkish Locale diff --git a/test/jdk/java/util/Locale/bug4123285.html b/test/jdk/java/util/Locale/bug4123285.html deleted file mode 100644 index 7cb7a3d07d8..00000000000 --- a/test/jdk/java/util/Locale/bug4123285.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/jdk/java/util/Locale/bug4123285.java b/test/jdk/java/util/Locale/bug4123285.java deleted file mode 100644 index 23cbb8ad5bd..00000000000 --- a/test/jdk/java/util/Locale/bug4123285.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2007, 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. - */ -import java.util.Locale; - -public class bug4123285 extends java.applet.Applet { - public void start() { - System.out.println("Hello, world!"); - Locale[] systemLocales = null; - try { - System.out.println("Default locale = " + Locale.getDefault()); - systemLocales = Locale.getAvailableLocales(); - System.out.println("Found " + systemLocales.length + " locales:"); - Locale[] locales = new Locale[systemLocales.length]; - for (int i = 0; i < locales.length; i++) { - Locale lowest = null; - for (int j = 0; j < systemLocales.length; j++) { - if (i > 0 && locales[i - 1].toString().compareTo(systemLocales[j].toString()) >= 0) - continue; - if (lowest == null || systemLocales[j].toString().compareTo(lowest.toString()) < 0) - lowest = systemLocales[j]; - } - locales[i] = lowest; - } - for (int i = 0; i < locales.length; i++) { - if (locales[i].getCountry().length() == 0) - System.out.println(" " + locales[i].getDisplayLanguage() + ":"); - else { - if (locales[i].getVariant().length() == 0) - System.out.println(" " + locales[i].getDisplayCountry()); - else - System.out.println(" " + locales[i].getDisplayCountry() + ", " - + locales[i].getDisplayVariant()); - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - } -}