Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
naotoj committed Nov 15, 2023
1 parent f6ae1d8 commit d51bb19
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public LocaleProviderAdapter.Type getAdapterType() {
protected Set<String> createLanguageTagSet(String category) {
return switch (category) {
case "BreakIteratorInfo", "BreakIteratorRules", "CollationData" -> {
// ensure to include en-US
// ensure to include en-US/en/ROOT
var s = new HashSet<>(super.createLanguageTagSet(category));
s.add("en-US");
s.addAll(Set.of("en-US", "en", "und"));
yield Collections.unmodifiableSet(s);
}
case "FormatData" -> Set.of("ja", "und");
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/java/util/Locale/ExpectedAdapterTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/*
* @test
* @bug 8008577 8138613
* @bug 8008577 8138613 8174269
* @summary Check whether CLDR locale provider adapter is enabled by default
* @compile -XDignore.symbol.file ExpectedAdapterTypes.java
* @modules java.base/sun.util.locale.provider
Expand All @@ -42,7 +42,7 @@ public class ExpectedAdapterTypes {

static final LocaleProviderAdapter.Type[] expected = {
LocaleProviderAdapter.Type.CLDR,
LocaleProviderAdapter.Type.JRE,
LocaleProviderAdapter.Type.FALLBACK,
};

/**
Expand Down
5 changes: 2 additions & 3 deletions test/jdk/java/util/Locale/RequiredAvailableLocalesTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 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
Expand All @@ -22,10 +22,9 @@
*/
/**
* @test
* @bug 8276186
* @bug 8276186 8174269
* @summary Checks whether getAvailableLocales() returns at least Locale.ROOT and
* Locale.US instances.
* @run testng/othervm -Djava.locale.providers=COMPAT RequiredAvailableLocalesTest
* @run testng/othervm -Djava.locale.providers=CLDR RequiredAvailableLocalesTest
*/

Expand Down
173 changes: 0 additions & 173 deletions test/jdk/sun/util/locale/provider/Bug8038436.java

This file was deleted.

45 changes: 0 additions & 45 deletions test/jdk/sun/util/locale/provider/Bug8163350.java

This file was deleted.

6 changes: 3 additions & 3 deletions test/jdk/sun/util/resources/Locale/Bug4429024.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,8 +24,8 @@
* @test
* @summary checking localised language/country names in finnish
* @modules jdk.localedata
* @bug 4429024 4964035 6558856 8008577 8287868
* @run main/othervm -Djava.locale.providers=JRE,SPI Bug4429024
* @bug 4429024 4964035 6558856 8008577 8287868 8174269
* @run main Bug4429024
*/

import java.util.Locale;
Expand Down
6 changes: 3 additions & 3 deletions test/jdk/sun/util/resources/Locale/Bug4965260.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,10 +22,10 @@
*/
/*
* @test
* @bug 4965260 8008577 8287868
* @bug 4965260 8008577 8287868 8174269
* @modules jdk.localedata
* @summary Verifies the language name of "nl" for supported locales
* @run main/othervm -Djava.locale.providers=JRE,SPI Bug4965260
* @run main Bug4965260
*/

import java.util.Locale;
Expand Down
8 changes: 6 additions & 2 deletions test/jdk/sun/util/resources/Locale/Bug6275682.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2016, 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
Expand All @@ -25,7 +25,7 @@
* @test
* @summary Verifying that the language names starts with lowercase in spanish
* @modules jdk.localedata
* @bug 6275682
* @bug 6275682 8174269
*/

import java.util.Locale;
Expand All @@ -38,6 +38,10 @@ public static void main (String[] args) throws Exception {
String error = "";

for (int i = 0; i < isoLangs.length; i++) {
// CLDR does not seem to have "bh" and "mo" language name in Spanish
if (isoLangs[i].equals("bh") || isoLangs[i].equals("mo")) {
continue;
}
Locale current = new Locale (isoLangs[i]);
String localeString = current.getDisplayLanguage (es);
String startLetter = localeString.substring (0,1);
Expand Down

0 comments on commit d51bb19

Please sign in to comment.