test/java/util/Locale/LocaleProviders.java

Print this page
rev 5994 : imported patch 8001205

*** 49,58 **** --- 49,62 ---- case "tzNameTest": tzNameTest(args[1]); break; + case "bug8001205Test": + bug8001205Test(); + break; + default: throw new RuntimeException("Test method '"+methodName+"' not found."); } }
*** 91,96 **** --- 95,109 ---- 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); } } + + static void bug8001205Test() { + Calendar cal = Calendar.getInstance(); + cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); + String sunday = cal.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT_STANDALONE, Locale.CHINA); + if (sunday == null) { + throw new RuntimeException("Calendar.getDisplayName(DAY_OF_WEEK/SHORT_STANDALONE) returned null."); + } + } }