test/java/time/test/java/time/format/TestDateTimeTextProvider.java

Print this page




 163             {MONTH_OF_YEAR, 3, TextStyle.FULL, ptBR, "Mar\u00E7o"},
 164             {MONTH_OF_YEAR, 4, TextStyle.FULL, ptBR, "Abril"},
 165             {MONTH_OF_YEAR, 5, TextStyle.FULL, ptBR, "Maio"},
 166             {MONTH_OF_YEAR, 6, TextStyle.FULL, ptBR, "Junho"},
 167             {MONTH_OF_YEAR, 7, TextStyle.FULL, ptBR, "Julho"},
 168             {MONTH_OF_YEAR, 8, TextStyle.FULL, ptBR, "Agosto"},
 169             {MONTH_OF_YEAR, 9, TextStyle.FULL, ptBR, "Setembro"},
 170             {MONTH_OF_YEAR, 10, TextStyle.FULL, ptBR, "Outubro"},
 171             {MONTH_OF_YEAR, 11, TextStyle.FULL, ptBR, "Novembro"},
 172             {MONTH_OF_YEAR, 12, TextStyle.FULL, ptBR, "Dezembro"},
 173 
 174             {AMPM_OF_DAY, 0, TextStyle.SHORT, enUS, "AM"},
 175             {AMPM_OF_DAY, 1, TextStyle.SHORT, enUS, "PM"},
 176 
 177         };
 178     }
 179 
 180     @Test(dataProvider = "Text")
 181     public void test_getText(TemporalField field, Number value, TextStyle style, Locale locale, String expected) {
 182           DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale);
 183           assertEquals(fmt.print(ZonedDateTime.now().with(field, value.longValue())), expected);
 184     }
 185 
 186 }


 163             {MONTH_OF_YEAR, 3, TextStyle.FULL, ptBR, "Mar\u00E7o"},
 164             {MONTH_OF_YEAR, 4, TextStyle.FULL, ptBR, "Abril"},
 165             {MONTH_OF_YEAR, 5, TextStyle.FULL, ptBR, "Maio"},
 166             {MONTH_OF_YEAR, 6, TextStyle.FULL, ptBR, "Junho"},
 167             {MONTH_OF_YEAR, 7, TextStyle.FULL, ptBR, "Julho"},
 168             {MONTH_OF_YEAR, 8, TextStyle.FULL, ptBR, "Agosto"},
 169             {MONTH_OF_YEAR, 9, TextStyle.FULL, ptBR, "Setembro"},
 170             {MONTH_OF_YEAR, 10, TextStyle.FULL, ptBR, "Outubro"},
 171             {MONTH_OF_YEAR, 11, TextStyle.FULL, ptBR, "Novembro"},
 172             {MONTH_OF_YEAR, 12, TextStyle.FULL, ptBR, "Dezembro"},
 173 
 174             {AMPM_OF_DAY, 0, TextStyle.SHORT, enUS, "AM"},
 175             {AMPM_OF_DAY, 1, TextStyle.SHORT, enUS, "PM"},
 176 
 177         };
 178     }
 179 
 180     @Test(dataProvider = "Text")
 181     public void test_getText(TemporalField field, Number value, TextStyle style, Locale locale, String expected) {
 182           DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale);
 183           assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected);
 184     }
 185 
 186 }