Code example for DateFormatSymbols

Methods: equals, setAmPmStrings, setEras

0
        assertTrue("Set incorrectly", newSym.equals(symbols));
        assertTrue("Not a clone", f1.getDateFormatSymbols() != symbols);
        String result = f1.format(new GregorianCalendar(1999, Calendar.JUNE,
                12, 3, 0).getTime());
        assertEquals("Incorrect symbols used", "morning", result);
        symbols.setEras(new String[] { "before", "after" });
        assertTrue("Identical symbols", !f1.getDateFormatSymbols().equals(
                symbols));
 
        try { 
            f1.setDateFormatSymbols(null);
            fail("NullPointerException was not thrown.");
        } catch(NullPointerException npe) {
            //expected 
        } 
    } 
 
    public void test_toLocalizedPattern() { 
        // BEGIN android-changed 
        // Test for method java.lang.String 
        // java.text.SimpleDateFormat.toLocalizedPattern()