--- old/test/java/util/Locale/LocaleProviders.java Fri May 3 17:23:36 2013 +++ new/test/java/util/Locale/LocaleProviders.java Fri May 3 17:23:34 2013 @@ -124,18 +124,33 @@ LocaleProviderAdapter lda = LocaleProviderAdapter.getAdapter(LocaleNameProvider.class, Locale.ENGLISH); LocaleProviderAdapter.Type type = lda.getAdapterType(); if (type == LocaleProviderAdapter.Type.HOST) { + LocaleNameProvider lnp = lda.getLocaleNameProvider(); Locale mkmk = Locale.forLanguageTag("mk-MK"); String result = mkmk.getDisplayLanguage(Locale.ENGLISH); - if (!"Macedonian (FYROM)".equals(result)) { - throw new RuntimeException("Windows locale name provider did not return expected localized language name for \"mk\". Returned name was \"" + result + "\""); + String expected = lnp.getDisplayLanguage(mkmk.getLanguage(), Locale.ENGLISH); + System.out.printf(" Display language name for (mk_MK): expected: \"%s\", returned: \"%s\"\n", expected, result); + if (result != null && + expected != null && + !result.equals(expected)) { + throw new RuntimeException("Windows locale name provider did not return expected localized language name for \"mk\". Returned name was \"" + result + "\", expected: \"" + expected + "\""); } result = Locale.US.getDisplayLanguage(Locale.ENGLISH); - if (!"English".equals(result)) { - throw new RuntimeException("Windows locale name provider did not return expected localized language name for \"en\". Returned name was \"" + result + "\""); + expected = lnp.getDisplayLanguage(Locale.US.getLanguage(), Locale.ENGLISH); + System.out.printf(" Display language name for (en_US): expected: \"%s\", returned: \"%s\"\n", expected, result); + if (result != null && + expected != null && + !result.equals(expected)) { + throw new RuntimeException("Windows locale name provider did not return expected localized language name for \"en\". Returned name was \"" + result + "\", expected: \"" + expected + "\""); } - result = Locale.US.getDisplayCountry(Locale.ENGLISH); - if (ver >= 6.1 && !"United States".equals(result)) { - throw new RuntimeException("Windows locale name provider did not return expected localized country name for \"US\". Returned name was \"" + result + "\""); + if (ver >= 6.1) { + result = Locale.US.getDisplayCountry(Locale.ENGLISH); + expected = lnp.getDisplayCountry(Locale.US.getCountry(), Locale.ENGLISH); + System.out.printf(" Display country name for (en_US): expected: \"%s\", returned: \"%s\"\n", expected, result); + if (result != null && + expected != null && + !result.equals(expected)) { + throw new RuntimeException("Windows locale name provider did not return expected localized country name for \"US\". Returned name was \"" + result + "\", expected: \"" + expected + "\""); + } } } else { throw new RuntimeException("Windows Host LocaleProviderAdapter was not selected for English locale."); --- old/test/java/util/Locale/LocaleProviders.sh Fri May 3 17:23:41 2013 +++ new/test/java/util/Locale/LocaleProviders.sh Fri May 3 17:23:40 2013 @@ -24,7 +24,7 @@ # # @test # @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8010666 -# 8013086 +# 8013086 8013233 # @summary tests for "java.locale.providers" system property # @compile -XDignore.symbol.file LocaleProviders.java # @run shell/timeout=600 LocaleProviders.sh