Skip to content

Commit 04c1546

Browse files
author
Justin Lu
committed
8358095: Cleanup tests with explicit locale provider set to only CLDR
Reviewed-by: bpb, naoto
1 parent 16e120b commit 04c1546

21 files changed

+58
-63
lines changed

test/jdk/java/text/Format/NumberFormat/CurrencyFormat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
2828
* @summary Basic tests for currency formatting.
2929
* Tests both COMPAT and CLDR data.
3030
* @modules jdk.localedata
31-
* @run junit/othervm -Djava.locale.providers=CLDR CurrencyFormat
31+
* @run junit CurrencyFormat
3232
*/
3333

3434
import java.io.File;

test/jdk/java/util/Calendar/Bug8007038.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
2929
* @modules java.base/sun.util.locale.provider
3030
* @modules jdk.localedata
3131
* @compile -XDignore.symbol.file Bug8007038.java
32-
* @run main/othervm -Djava.locale.providers=CLDR Bug8007038 CLDR
32+
* @run main Bug8007038 CLDR
3333
*/
3434

3535
import java.util.*;

test/jdk/java/util/Calendar/Bug8167273.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
3535
* java.base/sun.util.spi
3636
* jdk.localedata
3737
* @run main Bug8167273 testEraName
38-
* @run main/othervm -Djava.locale.providers=CLDR Bug8167273 testCldr
38+
* @run main Bug8167273 testCldr
3939
* @run main Bug8167273 testEmptyEraNames
4040
*/
4141
import java.text.DateFormatSymbols;

test/jdk/java/util/Calendar/CldrFormatNamesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
2828
* @modules java.base/sun.util.locale.provider
2929
* jdk.localedata
3030
* @compile -XDignore.symbol.file CldrFormatNamesTest.java
31-
* @run main/othervm -Djava.locale.providers=CLDR CldrFormatNamesTest
31+
* @run main CldrFormatNamesTest
3232
*/
3333

3434
import java.util.*;

test/jdk/java/util/Calendar/GenericTimeZoneNamesTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,12 +26,9 @@
2626
* @bug 8003267
2727
* @summary Unit test for generic time zone names support. This test is locale
2828
* data-dependent and assumes that both JRE and CLDR have the same
29-
* geneic time zone names in English.
29+
* generic time zone names in English.
3030
* @modules java.base/sun.util.locale.provider
31-
* @comment Locale providers: default
3231
* @run main GenericTimeZoneNamesTest en-US
33-
* @comment Locale providers: CLDR
34-
* @run main/othervm -Djava.locale.providers=CLDR GenericTimeZoneNamesTest en-US
3532
*/
3633

3734
import java.util.Locale;

test/jdk/java/util/Calendar/JapaneseEraNameTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,7 @@
2727
* @summary Test the localized Japanese new era name (May 1st. 2019-)
2828
* is retrieved no matter CLDR provider contains the name or not.
2929
* @modules jdk.localedata
30-
* @run testng/othervm JapaneseEraNameTest
31-
* @run testng/othervm -Djava.locale.providers=CLDR JapaneseEraNameTest
30+
* @run testng JapaneseEraNameTest
3231
*/
3332

3433
import static java.util.Calendar.*;

test/jdk/java/util/Calendar/NarrowNamesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
3131
* @comment Locale providers: CLDR,SPI
3232
* @run main/othervm -Djava.locale.providers=CLDR,SPI NarrowNamesTest CLDR,SPI
3333
* @comment Locale providers: CLDR
34-
* @run main/othervm -Djava.locale.providers=CLDR NarrowNamesTest CLDR
34+
* @run main NarrowNamesTest CLDR
3535
*/
3636

3737
import java.time.LocalDateTime;

test/jdk/java/util/Formatter/BasicTestLauncher.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -58,8 +58,7 @@
5858
* @run junit BasicTestLauncher
5959
*/
6060
public class BasicTestLauncher {
61-
// Locale flag for testJVM
62-
private static final String JAVA_OPTS = "-Djava.locale.providers=CLDR";
61+
6362
// Test class
6463
private static final String TEST_CLASS = "Basic";
6564

@@ -82,7 +81,7 @@ void testTimeZone(String timeZone) throws IOException{
8281
*/
8382
private static OutputAnalyzer RunTest(String timeZone) throws IOException{
8483
// Build and run Basic class with correct configuration
85-
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(JAVA_OPTS, TEST_CLASS);
84+
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(TEST_CLASS);
8685
pb.environment().put("TZ", timeZone);
8786
Process process = pb.start();
8887
return new OutputAnalyzer(process);

test/jdk/java/util/Locale/AliasesShouldBeRecognizedInCLDR.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
2626
* @bug 8179071 8202537 8231273 8251317
2727
* @summary Test that language aliases of CLDR supplemental metadata are handled correctly.
2828
* @modules jdk.localedata
29-
* @run junit/othervm -Djava.locale.providers=CLDR AliasesShouldBeRecognizedInCLDR
29+
* @run junit AliasesShouldBeRecognizedInCLDR
3030
*/
3131

3232
/*

test/jdk/java/util/Locale/RequiredAvailableLocalesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
2525
* @bug 8276186 8174269
2626
* @summary Checks whether getAvailableLocales() returns at least Locale.ROOT and
2727
* Locale.US instances.
28-
* @run testng/othervm -Djava.locale.providers=CLDR RequiredAvailableLocalesTest
28+
* @run testng RequiredAvailableLocalesTest
2929
*/
3030

3131
import java.lang.invoke.MethodHandles;

test/jdk/java/util/Locale/bcp47u/CurrencyFormatTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
2727
* @bug 8215181 8230284 8231273 8284840
2828
* @summary Tests the "u-cf" extension
2929
* @modules jdk.localedata
30-
* @run testng/othervm -Djava.locale.providers=CLDR CurrencyFormatTests
30+
* @run testng CurrencyFormatTests
3131
*/
3232

3333
import static org.testng.Assert.assertEquals;

test/jdk/java/util/Locale/bcp47u/DisplayNameTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
2727
* @bug 8176841 8202537
2828
* @summary Tests the display names for BCP 47 U extensions
2929
* @modules jdk.localedata
30-
* @run testng/othervm -Djava.locale.providers=CLDR DisplayNameTests
30+
* @run testng DisplayNameTests
3131
*/
3232

3333
import static org.testng.Assert.assertEquals;

test/jdk/java/util/Locale/bcp47u/FormatTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
2828
* @summary Tests *Format class deals with Unicode extensions
2929
* correctly.
3030
* @modules jdk.localedata
31-
* @run testng/othervm -Djava.locale.providers=CLDR FormatTests
31+
* @run testng FormatTests
3232
*/
3333

3434
import static org.testng.Assert.assertEquals;

test/jdk/java/util/Locale/bcp47u/SymbolsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
2828
* @summary Tests *FormatSymbols class deals with Unicode extensions
2929
* correctly.
3030
* @modules jdk.localedata
31-
* @run testng/othervm -Djava.locale.providers=CLDR SymbolsTests
31+
* @run testng SymbolsTests
3232
*/
3333

3434
import static org.testng.Assert.assertEquals;

test/jdk/java/util/TimeZone/Bug8167143.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
3535
* java.base/sun.util.spi
3636
* jdk.localedata
3737
* @run main Bug8167143 testTimeZone
38-
* @run main/othervm -Djava.locale.providers=CLDR Bug8167143 testCldr
38+
* @run main Bug8167143 testCldr
3939
* @run main Bug8167143 testCache
4040
* @run main Bug8167143 testCandidateLocales
4141
*/
@@ -236,40 +236,40 @@ private static void reportDifference(List<Locale> got, List<Locale> expected, St
236236
private static void testImplicitCompatLocales() {
237237
LocaleProviderAdapter jre = LocaleProviderAdapter.forJRE();
238238
checkPresenceCompat("BreakIteratorProvider",
239-
jre.getBreakIteratorProvider().getAvailableLocales());
239+
jre.getBreakIteratorProvider().getAvailableLocales());
240240
checkPresenceCompat("CollatorProvider",
241-
jre.getCollatorProvider().getAvailableLocales());
241+
jre.getCollatorProvider().getAvailableLocales());
242242
checkPresenceCompat("DateFormatProvider",
243-
jre.getDateFormatProvider().getAvailableLocales());
243+
jre.getDateFormatProvider().getAvailableLocales());
244244
checkPresenceCompat("DateFormatSymbolsProvider",
245-
jre.getDateFormatSymbolsProvider().getAvailableLocales());
245+
jre.getDateFormatSymbolsProvider().getAvailableLocales());
246246
checkPresenceCompat("DecimalFormatSymbolsProvider",
247-
jre.getDecimalFormatSymbolsProvider().getAvailableLocales());
247+
jre.getDecimalFormatSymbolsProvider().getAvailableLocales());
248248
checkPresenceCompat("NumberFormatProvider",
249-
jre.getNumberFormatProvider().getAvailableLocales());
249+
jre.getNumberFormatProvider().getAvailableLocales());
250250
checkPresenceCompat("CurrencyNameProvider",
251-
jre.getCurrencyNameProvider().getAvailableLocales());
251+
jre.getCurrencyNameProvider().getAvailableLocales());
252252
checkPresenceCompat("LocaleNameProvider",
253-
jre.getLocaleNameProvider().getAvailableLocales());
253+
jre.getLocaleNameProvider().getAvailableLocales());
254254
checkPresenceCompat("TimeZoneNameProvider",
255-
jre.getTimeZoneNameProvider().getAvailableLocales());
255+
jre.getTimeZoneNameProvider().getAvailableLocales());
256256
checkPresenceCompat("CalendarDataProvider",
257-
jre.getCalendarDataProvider().getAvailableLocales());
257+
jre.getCalendarDataProvider().getAvailableLocales());
258258
checkPresenceCompat("CalendarNameProvider",
259-
jre.getCalendarNameProvider().getAvailableLocales());
259+
jre.getCalendarNameProvider().getAvailableLocales());
260260
checkPresenceCompat("CalendarProvider",
261-
jre.getCalendarProvider().getAvailableLocales());
261+
jre.getCalendarProvider().getAvailableLocales());
262262
}
263263

264264
private static void checkPresenceCompat(String testName, Locale[] got) {
265265
List<Locale> gotLocalesList = Arrays.asList(got);
266266
List<Locale> gotList = new ArrayList<>(gotLocalesList);
267-
if (!gotList.removeAll(COMPAT_IMPLICIT_LOCS)) {
268-
// check which Implicit locale are not present in retrievedLocales List.
269-
List<Locale> implicitLocales = new ArrayList<>(COMPAT_IMPLICIT_LOCS);
270-
implicitLocales.removeAll(gotList);
271-
throw new RuntimeException("Locales those not correctly reflected are "
272-
+ implicitLocales + " for test " + testName);
273-
}
267+
if (!gotList.removeAll(COMPAT_IMPLICIT_LOCS)) {
268+
// check which Implicit locale are not present in retrievedLocales List.
269+
List<Locale> implicitLocales = new ArrayList<>(COMPAT_IMPLICIT_LOCS);
270+
implicitLocales.removeAll(gotList);
271+
throw new RuntimeException("Locales those not correctly reflected are "
272+
+ implicitLocales + " for test " + testName);
273+
}
274274
}
275275
}

test/jdk/java/util/TimeZone/CLDRDisplayNamesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @bug 8005471 8008577 8129881 8130845 8136518 8181157 8210490 8220037
2727
* 8234347 8236548 8317979
2828
* @modules jdk.localedata
29-
* @run main/othervm -Djava.locale.providers=CLDR CLDRDisplayNamesTest
29+
* @run main CLDRDisplayNamesTest
3030
* @summary Make sure that localized time zone names of CLDR are used
3131
* if specified.
3232
*/

test/jdk/sun/util/resources/TimeZone/ChineseTimeZoneNameTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
2626
* @bug 8275721 8174269
2727
* @modules jdk.localedata
2828
* @summary Checks Chinese time zone names for `UTC` using CLDR are consistent
29-
* @run testng/othervm -Djava.locale.providers=CLDR ChineseTimeZoneNameTest
29+
* @run testng ChineseTimeZoneNameTest
3030
*/
3131

3232
import java.time.Instant;

test/jdk/sun/util/resources/cldr/Bug8134250.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
2626
* @bug 8134250 8134520
2727
* @modules jdk.localedata
2828
* @summary Tests CLDR/LDML features are correctly reflected in JDK.
29-
* @run main/othervm -Djava.locale.providers=CLDR Bug8134250
29+
* @run main Bug8134250
3030
*/
3131

3232
// Note this test highly depends on a particular version of CLDR. Results

test/jdk/sun/util/resources/cldr/Bug8134384.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @test
2626
* @bug 8134384 8234347 8236548 8347841
2727
* @summary Tests CLDR TimeZoneNames has English names for all tzids
28-
* @run main/othervm -Djava.locale.providers=CLDR Bug8134384
28+
* @run main Bug8134384
2929
*/
3030

3131
import java.text.*;

test/jdk/sun/util/resources/cldr/LikelySubtagLocalesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @bug 8145136 8202537 8221432 8251317 8258794 8265315 8306116 8346948
2727
* @modules jdk.localedata
2828
* @summary Tests LikelySubtags is correctly reflected in Locale.getAvailableLocales().
29-
* @run junit/othervm -Djava.locale.providers=CLDR LikelySubtagLocalesTest
29+
* @run junit LikelySubtagLocalesTest
3030
*/
3131
import java.util.Arrays;
3232
import java.util.List;

test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @modules jdk.localedata
2828
* @summary Checks CLDR time zone names are generated correctly at
2929
* either build or runtime
30-
* @run testng/othervm -Djava.locale.providers=CLDR TimeZoneNamesTest
30+
* @run testng TimeZoneNamesTest
3131
*/
3232

3333
import java.text.DateFormatSymbols;

0 commit comments

Comments
 (0)