test/java/util/Locale/LocaleProviders.java

Print this page
rev 5931 : imported patch 8000245.8000273.8000615

@@ -45,10 +45,14 @@
 
             case "bug7198834Test":
                 bug7198834Test();
                 break;
 
+            case "tzNameTest":
+                tzNameTest(args[1]);
+                break;
+
             default:
                 throw new RuntimeException("Test method '"+methodName+"' not found.");
         }
     }
 

@@ -79,6 +83,14 @@
             }
         } else {
             System.out.println("Windows HOST locale adapter not found. Ignoring this test.");
         }
     }
+
+    static void tzNameTest(String id) {
+        TimeZone tz = TimeZone.getTimeZone(id);
+        String tzName = tz.getDisplayName(false, TimeZone.SHORT, Locale.US);
+        if (tzName.startsWith("GMT")) {
+            throw new RuntimeException("JRE's localized time zone name for "+id+" could not be retrieved. Returned name was: "+tzName);
+        } 
+    }
 }