test/java/util/Locale/LocaleProviders.java
Print this page
rev 5957 : imported patch 8000245.8000273.8000615
*** 45,54 ****
--- 45,58 ----
case "bug7198834Test":
bug7198834Test();
break;
+ case "tzNameTest":
+ tzNameTest(args[1]);
+ break;
+
default:
throw new RuntimeException("Test method '"+methodName+"' not found.");
}
}
*** 79,84 ****
--- 83,96 ----
}
} 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);
+ }
+ }
}