jdk/test/java/util/Locale/LocaleProviders.java
changeset 14185 916ec0a4d039
parent 14028 5f3d5ae5f1ea
child 14336 4a3418a2c07f
--- a/jdk/test/java/util/Locale/LocaleProviders.java	Mon Oct 15 22:34:35 2012 +0100
+++ b/jdk/test/java/util/Locale/LocaleProviders.java	Tue Oct 16 10:59:21 2012 -0700
@@ -47,6 +47,10 @@
                 bug7198834Test();
                 break;
 
+            case "tzNameTest":
+                tzNameTest(args[1]);
+                break;
+
             default:
                 throw new RuntimeException("Test method '"+methodName+"' not found.");
         }
@@ -81,4 +85,12 @@
             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);
+        }
+    }
 }