java.time.format.TextStyle Java Examples

The following examples show how to use java.time.format.TextStyle. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestZoneTextPrinterParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="preferredZones")
    Object[][] data_preferredZones() {
        return new Object[][] {
            {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
            {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Taipei",      "China Standard Time",   preferred, Locale.ENGLISH, TextStyle.FULL},
            {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
            {"Australia/South",  "CST",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
       };
    }
 
Example #2
Source File: TestZoneTextPrinterParser.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void parseText(Set<String> zids, Locale locale, TextStyle style, boolean ci) {
    System.out.println("---------------------------------------");
    DateTimeFormatter fmt = getFormatter(locale, style, ci);
    for (String[] names : new DateFormatSymbols(locale).getZoneStrings()) {
        if (!zids.contains(names[0])) {
            continue;
        }
        String zid = names[0];
        String expected = ZoneName.toZid(zid, locale);

        parse(fmt, zid, expected, zid, locale, style, ci);
        int i = style == TextStyle.FULL ? 1 : 2;
        for (; i < names.length; i += 2) {
            parse(fmt, zid, expected, names[i], locale, style, ci);
        }
    }
}
 
Example #3
Source File: TestZoneTextPrinterParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void parse(DateTimeFormatter fmt,
                   String zid, String expected, String text,
                   Locale locale, TextStyle style, boolean ci) {
    if (ci) {
        text = text.toUpperCase();
    }
    String ret = fmt.parse(text, TemporalQueries.zone()).getId();
    // TBD: need an excluding list
    // assertEquals(...);
    if (ret.equals(expected) ||
        ret.equals(zid) ||
        ret.equals(ZoneName.toZid(zid)) ||
        ret.equals(expected.replace("UTC", "UCT"))) {
        return;
    }
    System.out.printf("[%-5s %s %s %16s] %24s -> %s(%s)%n",
                      locale.toString(),
                      ci ? "ci" : "  ",
                      style == TextStyle.FULL ? " full" :"short",
                      zid, text, ret, expected);
}
 
Example #4
Source File: TestZoneTextPrinterParser.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void parseText(Set<String> zids, Locale locale, TextStyle style, boolean ci) {
    System.out.println("---------------------------------------");
    DateTimeFormatter fmt = getFormatter(locale, style, ci);
    for (String[] names : new DateFormatSymbols(locale).getZoneStrings()) {
        if (!zids.contains(names[0])) {
            continue;
        }
        String zid = names[0];
        String expected = ZoneName.toZid(zid, locale);

        parse(fmt, zid, expected, zid, locale, style, ci);
        int i = style == TextStyle.FULL ? 1 : 2;
        for (; i < names.length; i += 2) {
            parse(fmt, zid, expected, names[i], locale, style, ci);
        }
    }
}
 
Example #5
Source File: TestZoneTextPrinterParser.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@DataProvider(name="preferredZones")
    Object[][] data_preferredZones() {
        return new Object[][] {
            {"America/New_York", "Eastern Standard Time", none,      Locale.ENGLISH, TextStyle.FULL},
//          {"EST",              "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Europe/Paris",     "Central European Time", none,      Locale.ENGLISH, TextStyle.FULL},
            {"CET",              "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Shanghai",    "China Standard Time",   none,      Locale.ENGLISH, TextStyle.FULL},
            {"Asia/Taipei",      "China Standard Time",   preferred, Locale.ENGLISH, TextStyle.FULL},
            {"America/Chicago",  "CST",                   none,      Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Taipei",      "CST",                   preferred, Locale.ENGLISH, TextStyle.SHORT},
            {"Australia/South",  "ACST",                  preferred_s, Locale.ENGLISH, TextStyle.SHORT},
            {"America/Chicago",  "CDT",                   none,        Locale.ENGLISH, TextStyle.SHORT},
            {"Asia/Shanghai",    "CDT",                   preferred_s, Locale.ENGLISH, TextStyle.SHORT},
       };
    }
 
Example #6
Source File: TestTextParser.java    From j2objc with Apache License 2.0 5 votes vote down vote up
@Test
public void test_parse_full_strict_number_noMatch() throws Exception {
    setStrict(true);
    ParsePosition pos = new ParsePosition(0);
    getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("1", pos);
    assertEquals(pos.getErrorIndex(), 0);
}
 
Example #7
Source File: TCKDateTimeFormatters.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void test_pattern_String() {
    DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy");
    Locale fmtLocale = Locale.getDefault(Locale.Category.FORMAT);
    assertEquals(test.format(LocalDate.of(2012, 6, 30)), "30 " +
            Month.JUNE.getDisplayName(TextStyle.SHORT, fmtLocale) + " 2012");
    assertEquals(test.getLocale(), fmtLocale, "Locale.Category.FORMAT");
}
 
Example #8
Source File: TCKDateTimeTextPrinting.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="printText")
public void test_appendText2arg_format(TemporalField field, TextStyle style, int value, String expected) throws Exception {
    DateTimeFormatter f = builder.appendText(field, style).toFormatter(Locale.ENGLISH);
    LocalDateTime dt = LocalDateTime.of(2010, 1, 1, 0, 0);
    dt = dt.with(field, value);
    String text = f.format(dt);
    assertEquals(text, expected);
}
 
Example #9
Source File: TestTextParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void test_parse_noMatch1() throws Exception {
    ParsePosition pos = new ParsePosition(0);
    TemporalAccessor parsed =
        getFormatter(DAY_OF_WEEK, TextStyle.FULL).parseUnresolved("Munday", pos);
    assertEquals(pos.getErrorIndex(), 0);
    assertEquals(parsed, null);
}
 
Example #10
Source File: TestZoneTextPrinterParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private DateTimeFormatter getFormatter(Locale locale, TextStyle style, boolean ci) {
    DateTimeFormatterBuilder db = new DateTimeFormatterBuilder();
    if (ci) {
        db = db.parseCaseInsensitive();
    }
    return db.appendZoneText(style)
             .toFormatter(locale)
             .withDecimalStyle(DecimalStyle.of(locale));
}
 
Example #11
Source File: TestTextParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="error")
public void test_parse_error(TemporalField field, TextStyle style, String text, int pos, Class<?> expected) {
    try {
        getFormatter(field, style).parseUnresolved(text, new ParsePosition(pos));
    } catch (RuntimeException ex) {
        assertTrue(expected.isInstance(ex));
    }
}
 
Example #12
Source File: DateTimeParserTest.java    From jphp with Apache License 2.0 5 votes vote down vote up
@Test
public void justMonth() {
    Locale l = Locale.US;
    for (Month month : Month.values()) {
        for (TextStyle value : Arrays.asList(TextStyle.FULL, TextStyle.SHORT)) {
            String monthName = month.getDisplayName(value, l);
            ZonedDateTime now = now();
            ZonedDateTime expected = now.withMonth(month.getValue()).truncatedTo(DAYS);

            assertThat(parse(monthName, now)).isEqualToIgnoringSeconds(expected);
            assertThat(parse(monthName.toLowerCase(), now)).isEqualToIgnoringSeconds(expected);
            assertThat(parse(monthName.toUpperCase(), now)).isEqualToIgnoringSeconds(expected);
        }
    }
}
 
Example #13
Source File: TestTextParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="parseText")
public void test_parse_strict_caseSensitive_parseLower(TemporalField field, TextStyle style, int value, String input) throws Exception {
    if (input.equals(input.toLowerCase(Locale.ROOT))) {
        // Skip if the given input is all lower case (e.g., "1st quarter")
        return;
    }
    setCaseSensitive(true);
    ParsePosition pos = new ParsePosition(0);
    getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos);
    assertEquals(pos.getErrorIndex(), 0);
}
 
Example #14
Source File: TestZoneTextPrinterParser.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void printText(Locale locale, ZonedDateTime zdt, TextStyle style, TimeZone zone, String expected) {
    String result = getFormatter(locale, style).format(zdt);
    if (!result.equals(expected)) {
        if (result.equals("FooLocation")) { // from rules provider test if same vm
            return;
        }
        System.out.println("----------------");
        System.out.printf("tdz[%s]%n", zdt.toString());
        System.out.printf("[%-5s, %5s] :[%s]%n", locale.toString(), style.toString(),result);
        System.out.printf(" %5s, %5s  :[%s] %s%n", "", "", expected, zone);
    }
    assertEquals(result, expected);
}
 
Example #15
Source File: TestTextParser.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="parseStandaloneText")
public void test_parseStandaloneText(Locale locale, TemporalField field, TextStyle style, int expectedValue, String input) {
    DateTimeFormatter formatter = getFormatter(field, style).withLocale(locale);
    ParsePosition pos = new ParsePosition(0);
    assertEquals(formatter.parseUnresolved(input, pos).getLong(field), (long) expectedValue);
    assertEquals(pos.getIndex(), input.length());
}
 
Example #16
Source File: TestTextParser.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="parseNumber")
Object[][] provider_number() {
    return new Object[][] {
        {DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
        {DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
        {DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
        {DAY_OF_MONTH, TextStyle.FULL, 31, "31"},

        {DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
        {DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
        {DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
        {DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
   };
}
 
Example #17
Source File: TCKOffsetPrinterParser.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="print_localized")
public void test_print_localized(TextStyle style, LocalDateTime ldt, ZoneOffset offset, String expected) {
    OffsetDateTime odt = OffsetDateTime.of(ldt, offset);
    ZonedDateTime zdt = ldt.atZone(offset);

    DateTimeFormatter f = new DateTimeFormatterBuilder().appendLocalizedOffset(style)
                                                        .toFormatter();
    assertEquals(f.format(odt), expected);
    assertEquals(f.format(zdt), expected);
    assertEquals(f.parse(expected, ZoneOffset::from), offset);

    if (style == TextStyle.FULL) {
        f = new DateTimeFormatterBuilder().appendPattern("ZZZZ")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);

        f = new DateTimeFormatterBuilder().appendPattern("OOOO")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }

    if (style == TextStyle.SHORT) {
        f = new DateTimeFormatterBuilder().appendPattern("O")
                                          .toFormatter();
        assertEquals(f.format(odt), expected);
        assertEquals(f.format(zdt), expected);
        assertEquals(f.parse(expected, ZoneOffset::from), offset);
    }
}
 
Example #18
Source File: TestTextParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="parseNumber")
Object[][] provider_number() {
    return new Object[][] {
        {DAY_OF_MONTH, TextStyle.FULL, 1, "1"},
        {DAY_OF_MONTH, TextStyle.FULL, 2, "2"},
        {DAY_OF_MONTH, TextStyle.FULL, 30, "30"},
        {DAY_OF_MONTH, TextStyle.FULL, 31, "31"},

        {DAY_OF_MONTH, TextStyle.SHORT, 1, "1"},
        {DAY_OF_MONTH, TextStyle.SHORT, 2, "2"},
        {DAY_OF_MONTH, TextStyle.SHORT, 30, "30"},
        {DAY_OF_MONTH, TextStyle.SHORT, 31, "31"},
   };
}
 
Example #19
Source File: TestTextParser.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="parseText")
public void test_parse_strict_caseInsensitive_parseLower(TemporalField field, TextStyle style, int value, String input) throws Exception {
    setCaseSensitive(false);
    ParsePosition pos = new ParsePosition(0);
    assertEquals(getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos).getLong(field), (long) value);
    assertEquals(pos.getIndex(), input.length());
}
 
Example #20
Source File: TCKZoneId.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="offsetBasedValidPrefix")
public void factory_of_String_offsetBasedValid_prefixUTC(String input, String id, String offsetId) {
    ZoneId test = ZoneId.of("UTC" + input);
    assertEquals(test.getId(), "UTC" + id);
    assertEquals(test.getRules(), ZoneOffset.of(offsetId).getRules());
    assertEquals(test.normalized(), ZoneOffset.of(offsetId));
    assertEquals(test.getDisplayName(TextStyle.FULL, Locale.UK), displayName("UTC" + id));
    assertEquals(test.getRules().isFixedOffset(), true);
    assertEquals(test.getRules().getOffset(Instant.EPOCH), ZoneOffset.of(offsetId));
}
 
Example #21
Source File: TestTextParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="parseText")
public void test_parse_strict_caseInsensitive_parseLower(TemporalField field, TextStyle style, int value, String input) throws Exception {
    setCaseSensitive(false);
    ParsePosition pos = new ParsePosition(0);
    assertEquals(getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos).getLong(field), (long) value);
    assertEquals(pos.getIndex(), input.length());
}
 
Example #22
Source File: TestTextParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void test_parse_remainderIgnored() throws Exception {
    ParsePosition pos = new ParsePosition(0);
    assertEquals(getFormatter(DAY_OF_WEEK, TextStyle.SHORT)
                 .parseUnresolved("Wednesday", pos)
                 .getLong(DAY_OF_WEEK), 3L);
    assertEquals(pos.getIndex(), 3);
}
 
Example #23
Source File: TestTextParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void test_parse_midStr() throws Exception {
    ParsePosition pos = new ParsePosition(3);
    assertEquals(getFormatter(DAY_OF_WEEK, TextStyle.FULL)
                 .parseUnresolved("XxxMondayXxx", pos)
                 .getLong(DAY_OF_WEEK), 1L);
    assertEquals(pos.getIndex(), 9);
}
 
Example #24
Source File: TestTextParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="parseStandaloneText")
public void test_parseStandaloneText(Locale locale, TemporalField field, TextStyle style, int expectedValue, String input) {
    DateTimeFormatter formatter = getFormatter(field, style).withLocale(locale);
    ParsePosition pos = new ParsePosition(0);
    assertEquals(formatter.parseUnresolved(input, pos).getLong(field), (long) expectedValue);
    assertEquals(pos.getIndex(), input.length());
}
 
Example #25
Source File: TestTextParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void test_parse_french_short_strict_short_match() throws Exception {
    setStrict(true);
    ParsePosition pos = new ParsePosition(0);
    assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).withLocale(Locale.FRENCH)
                                                             .parseUnresolved("janv.", pos)
                                                             .getLong(MONTH_OF_YEAR),
                 1L);
    assertEquals(pos.getIndex(), 5);
}
 
Example #26
Source File: TCKOffsetPrinterParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_localized")
Object[][] data_print_localized() {
    return new Object[][] {
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+01:00"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+01:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+00:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+01:23:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-01:00"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-01:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-00:23"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-01:23:45"},
            {TextStyle.FULL, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-00:00:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_UTC, "GMT"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0100, "GMT+1"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0123, "GMT+1:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P0023, "GMT+0:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_P012345, "GMT+1:23:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0100, "GMT-1"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0123, "GMT-1:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M0023, "GMT-0:23"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M012345, "GMT-1:23:45"},
            {TextStyle.SHORT, DT_2012_06_30_12_30_40, OFFSET_M000045, "GMT-0:00:45"},
    };
}
 
Example #27
Source File: TCKZoneId.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="offsetBasedValidPrefix")
public void factory_of_String_offsetBasedValid_prefixUT(String input, String id, String offsetId) {
    ZoneId test = ZoneId.of("UT" + input);
    assertEquals(test.getId(), "UT" + id);
    assertEquals(test.getRules(), ZoneOffset.of(offsetId).getRules());
    assertEquals(test.normalized(), ZoneOffset.of(offsetId));
    assertEquals(test.getDisplayName(TextStyle.FULL, Locale.UK), displayName("UT" + id));
    assertEquals(test.getRules().isFixedOffset(), true);
    assertEquals(test.getRules().getOffset(Instant.EPOCH), ZoneOffset.of(offsetId));
}
 
Example #28
Source File: TCKZoneId.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="offsetBasedValidPrefix")
public void factory_of_String_offsetBasedValid_prefixUT(String input, String id, String offsetId) {
    ZoneId test = ZoneId.of("UT" + input);
    assertEquals(test.getId(), "UT" + id);
    assertEquals(test.getRules(), ZoneOffset.of(offsetId).getRules());
    assertEquals(test.normalized(), ZoneOffset.of(offsetId));
    assertEquals(test.getDisplayName(TextStyle.FULL, Locale.UK), displayName("UT" + id));
    assertEquals(test.getRules().isFixedOffset(), true);
    assertEquals(test.getRules().getOffset(Instant.EPOCH), ZoneOffset.of(offsetId));
}
 
Example #29
Source File: TestTextParser.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="parseStandaloneText")
Object[][] providerStandaloneText() {
    // Locale, TemporalField, TextStyle, expected value, input text
    return new Object[][] {
        {RUSSIAN, MONTH_OF_YEAR, TextStyle.FULL_STANDALONE,   1, "\u042f\u043d\u0432\u0430\u0440\u044c"},
        {RUSSIAN, MONTH_OF_YEAR, TextStyle.FULL_STANDALONE,  12, "\u0414\u0435\u043a\u0430\u0431\u0440\u044c"},
        {RUSSIAN, MONTH_OF_YEAR, TextStyle.SHORT_STANDALONE,  1, "\u042f\u043d\u0432."},
        {RUSSIAN, MONTH_OF_YEAR, TextStyle.SHORT_STANDALONE, 12, "\u0414\u0435\u043a."},
        {FINNISH, DAY_OF_WEEK,   TextStyle.FULL_STANDALONE,   2, "tiistai"},
        {FINNISH, DAY_OF_WEEK,   TextStyle.SHORT_STANDALONE,  2, "ti"},
    };
}
 
Example #30
Source File: TestTextParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Test(dataProvider="parseText")
public void test_parse_strict_caseInsensitive_parseLower(TemporalField field, TextStyle style, int value, String input) throws Exception {
    setCaseSensitive(false);
    ParsePosition pos = new ParsePosition(0);
    assertEquals(getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos).getLong(field), (long) value);
    assertEquals(pos.getIndex(), input.length());
}