Code example for DateFormatSymbols

Methods: getMonthsgetWeekdaysgetZoneStrings

0
        assertEquals("en_US_POSIX", locale.toString());
    } 
 
    public void testResourceBundles() throws Exception { 
        Locale eng = new Locale("en", "US");
        DateFormatSymbols engSymbols = new DateFormatSymbols(eng);
 
        Locale deu = new Locale("de", "DE");
        DateFormatSymbols deuSymbols = new DateFormatSymbols(deu);
 
        TimeZone berlin = TimeZone.getTimeZone("Europe/Berlin");
 
        assertEquals("January", engSymbols.getMonths()[0]);
        assertEquals("Januar", deuSymbols.getMonths()[0]);
 
        assertEquals("Sunday", engSymbols.getWeekdays()[Calendar.SUNDAY]);
        assertEquals("Sonntag", deuSymbols.getWeekdays()[Calendar.SUNDAY]);
 
        assertEquals("Central European Time",
                berlin.getDisplayName(false, TimeZone.LONG, eng));
        assertEquals("Central European Summer Time",
                berlin.getDisplayName(true, TimeZone.LONG, eng));
 
        assertEquals("Mitteleurop\u00E4ische Zeit",
                berlin.getDisplayName(false, TimeZone.LONG, deu));
        assertEquals("Mitteleurop\u00E4ische Sommerzeit",
                berlin.getDisplayName(true, TimeZone.LONG, deu));
 
        assertTrue(engSymbols.getZoneStrings().length > 100);
    } 
 
    // This one makes sure we have all necessary locales installed. 
    // Suppress this flaky test for now. 
    public void testICULocales() {