8236495: open/test/jdk/java/util/Locale/LocaleProvidersRun.java failed on mac 10.14 with de_DE locale

Reviewed-by: lancea, clanger
This commit is contained in:
Naoto Sato 2020-01-06 17:23:57 -08:00
parent 151ab6acc1
commit e72f6028fb
2 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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
@ -338,9 +338,12 @@ public class LocaleProviders {
var nfExpectedList = List.of("123", "123.4");
var ifExpectedList = List.of("123", "123");
var defLoc = Locale.getDefault(Locale.Category.FORMAT);
var type = LocaleProviderAdapter.getAdapter(CalendarNameProvider.class, Locale.US)
.getAdapterType();
if (type == LocaleProviderAdapter.Type.HOST && (IS_WINDOWS || IS_MAC)) {
if (defLoc.equals(Locale.US) &&
type == LocaleProviderAdapter.Type.HOST &&
(IS_WINDOWS || IS_MAC)) {
final var numf = NumberFormat.getNumberInstance(Locale.US);
final var intf = NumberFormat.getIntegerInstance(Locale.US);
@ -366,6 +369,7 @@ public class LocaleProviders {
System.out.println("bug8232860Test succeeded.");
} else {
System.out.println("Test ignored. Either :-\n" +
"Default format locale is not Locale.US: " + defLoc + ", or\n" +
"OS is neither macOS/Windows, or\n" +
"provider is not HOST: " + type);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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,7 +25,7 @@
* @test
* @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
* 8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006
* 8150432 8215913 8220227 8228465 8232871 8232860
* 8150432 8215913 8220227 8228465 8232871 8232860 8236495
* @summary tests for "java.locale.providers" system property
* @library /test/lib
* @build LocaleProviders