changeset 57466:8d3112f373d5

8236495: open/test/jdk/java/util/Locale/LocaleProvidersRun.java failed on mac 10.14 with de_DE locale. Reviewed-by: lancea, clanger
author naoto
date Mon, 06 Jan 2020 17:23:57 -0800
parents 01343dec4f0a
children 32d0fe687ec2
files test/jdk/java/util/Locale/LocaleProviders.java test/jdk/java/util/Locale/LocaleProvidersRun.java
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/java/util/Locale/LocaleProviders.java	Fri Jan 03 13:40:33 2020 -0800
+++ b/test/jdk/java/util/Locale/LocaleProviders.java	Mon Jan 06 17:23:57 2020 -0800
@@ -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 @@
         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 @@
             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);
         }
--- a/test/jdk/java/util/Locale/LocaleProvidersRun.java	Fri Jan 03 13:40:33 2020 -0800
+++ b/test/jdk/java/util/Locale/LocaleProvidersRun.java	Mon Jan 06 17:23:57 2020 -0800
@@ -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