java.time.chrono.MinguoDate Java Examples
The following examples show how to use
java.time.chrono.MinguoDate.
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: TCKMinguoChronology.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_ymaa") public void test_resolve_ymaa_smart(int y, int m, int w, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.ALIGNED_WEEK_OF_MONTH, (long) w); fieldValues.put(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH, (long) d); if (smart) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #2
Source File: TestReducedPrinter.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void test_minguoChrono_extendedWidth() throws Exception { // ISO 2021 is Minguo 110 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 4, 2021); MinguoDate date = MinguoDate.of(109, 6, 30); assertEquals(f.format(date), "109"); date = MinguoDate.of(110, 6, 30); assertEquals(f.format(date), "10"); date = MinguoDate.of(199, 6, 30); assertEquals(f.format(date), "99"); date = MinguoDate.of(200, 6, 30); assertEquals(f.format(date), "00"); date = MinguoDate.of(209, 6, 30); assertEquals(f.format(date), "09"); date = MinguoDate.of(210, 6, 30); assertEquals(f.format(date), "210"); }
Example #3
Source File: TestReducedPrinter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void test_minguoChrono_fixedWidth() throws Exception { // ISO 2021 is Minguo 110 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 2, 2021); MinguoDate date = MinguoDate.of(109, 6, 30); assertEquals(f.format(date), "09"); date = MinguoDate.of(110, 6, 30); assertEquals(f.format(date), "10"); date = MinguoDate.of(199, 6, 30); assertEquals(f.format(date), "99"); date = MinguoDate.of(200, 6, 30); assertEquals(f.format(date), "00"); date = MinguoDate.of(209, 6, 30); assertEquals(f.format(date), "09"); date = MinguoDate.of(210, 6, 30); assertEquals(f.format(date), "10"); }
Example #4
Source File: TCKMinguoChronology.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yd") public void test_resolve_yd_smart(int y, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.DAY_OF_YEAR, (long) d); if (smart) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #5
Source File: TCKMinguoChronology.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@Test public void test_dateNow(){ assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now()) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now(ZoneId.systemDefault())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now(Clock.systemDefaultZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now(Clock.systemDefaultZone().getZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoChronology.INSTANCE.dateNow(ZoneId.systemDefault())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoChronology.INSTANCE.dateNow(Clock.systemDefaultZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoChronology.INSTANCE.dateNow(Clock.systemDefaultZone().getZone())) ; ZoneId zoneId = ZoneId.of("Europe/Paris"); assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoChronology.INSTANCE.dateNow(Clock.system(zoneId))) ; assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoChronology.INSTANCE.dateNow(Clock.system(zoneId).getZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoDate.now(Clock.system(zoneId))) ; assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoDate.now(Clock.system(zoneId).getZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(ZoneId.of(ZoneOffset.UTC.getId())), MinguoChronology.INSTANCE.dateNow(Clock.systemUTC())) ; }
Example #6
Source File: TCKMinguoChronology.java From hottub with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_ymd") public void test_resolve_ymd_strict(int y, int m, int d, MinguoDate expected, Object smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.DAY_OF_MONTH, (long) d); if (strict) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #7
Source File: TCKMinguoChronology.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yd") public void test_resolve_yd_strict(int y, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.DAY_OF_YEAR, (long) d); if (strict) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #8
Source File: TCKMinguoChronology.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yearOfEra") public void test_resolve_yearOfEra(ResolverStyle style, Integer e, Integer yoe, Integer y, ChronoField field, Integer expected) { Map<TemporalField, Long> fieldValues = new HashMap<>(); if (e != null) { fieldValues.put(ChronoField.ERA, (long) e); } if (yoe != null) { fieldValues.put(ChronoField.YEAR_OF_ERA, (long) yoe); } if (y != null) { fieldValues.put(ChronoField.YEAR, (long) y); } if (field != null) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, style); assertEquals(date, null); assertEquals(fieldValues.get(field), (Long) expected.longValue()); assertEquals(fieldValues.size(), 1); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, style); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #9
Source File: TCKMinguoChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yd") public void test_resolve_yd_smart(int y, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.DAY_OF_YEAR, (long) d); if (smart) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #10
Source File: TestReducedPrinter.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void test_minguoChrono_extendedWidth() throws Exception { // ISO 2021 is Minguo 110 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 4, 2021); MinguoDate date = MinguoDate.of(109, 6, 30); assertEquals(f.format(date), "109"); date = MinguoDate.of(110, 6, 30); assertEquals(f.format(date), "10"); date = MinguoDate.of(199, 6, 30); assertEquals(f.format(date), "99"); date = MinguoDate.of(200, 6, 30); assertEquals(f.format(date), "00"); date = MinguoDate.of(209, 6, 30); assertEquals(f.format(date), "09"); date = MinguoDate.of(210, 6, 30); assertEquals(f.format(date), "210"); }
Example #11
Source File: TCKMinguoChronology.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yearOfEra") public void test_resolve_yearOfEra(ResolverStyle style, Integer e, Integer yoe, Integer y, ChronoField field, Integer expected) { Map<TemporalField, Long> fieldValues = new HashMap<>(); if (e != null) { fieldValues.put(ChronoField.ERA, (long) e); } if (yoe != null) { fieldValues.put(ChronoField.YEAR_OF_ERA, (long) yoe); } if (y != null) { fieldValues.put(ChronoField.YEAR, (long) y); } if (field != null) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, style); assertEquals(date, null); assertEquals(fieldValues.get(field), (Long) expected.longValue()); assertEquals(fieldValues.size(), 1); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, style); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #12
Source File: TCKMinguoChronology.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_ymaa") public void test_resolve_ymaa_smart(int y, int m, int w, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.ALIGNED_WEEK_OF_MONTH, (long) w); fieldValues.put(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH, (long) d); if (smart) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.SMART); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #13
Source File: TCKMinguoChronology.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yearOfEra") public void test_resolve_yearOfEra(ResolverStyle style, Integer e, Integer yoe, Integer y, ChronoField field, Integer expected) { Map<TemporalField, Long> fieldValues = new HashMap<>(); if (e != null) { fieldValues.put(ChronoField.ERA, (long) e); } if (yoe != null) { fieldValues.put(ChronoField.YEAR_OF_ERA, (long) yoe); } if (y != null) { fieldValues.put(ChronoField.YEAR, (long) y); } if (field != null) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, style); assertEquals(date, null); assertEquals(fieldValues.get(field), (Long) expected.longValue()); assertEquals(fieldValues.size(), 1); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, style); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #14
Source File: TCKMinguoChronology.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_ymd") public void test_resolve_ymd_strict(int y, int m, int d, MinguoDate expected, Object smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.DAY_OF_MONTH, (long) d); if (strict) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #15
Source File: TCKMinguoChronology.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_ymd") public void test_resolve_ymd_strict(int y, int m, int d, MinguoDate expected, Object smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.DAY_OF_MONTH, (long) d); if (strict) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #16
Source File: TCKMinguoChronology.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@Test public void test_dateNow(){ assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now()) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now(ZoneId.systemDefault())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now(Clock.systemDefaultZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoDate.now(Clock.systemDefaultZone().getZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoChronology.INSTANCE.dateNow(ZoneId.systemDefault())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoChronology.INSTANCE.dateNow(Clock.systemDefaultZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(), MinguoChronology.INSTANCE.dateNow(Clock.systemDefaultZone().getZone())) ; ZoneId zoneId = ZoneId.of("Europe/Paris"); assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoChronology.INSTANCE.dateNow(Clock.system(zoneId))) ; assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoChronology.INSTANCE.dateNow(Clock.system(zoneId).getZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoDate.now(Clock.system(zoneId))) ; assertEquals(MinguoChronology.INSTANCE.dateNow(zoneId), MinguoDate.now(Clock.system(zoneId).getZone())) ; assertEquals(MinguoChronology.INSTANCE.dateNow(ZoneId.of(ZoneOffset.UTC.getId())), MinguoChronology.INSTANCE.dateNow(Clock.systemUTC())) ; }
Example #17
Source File: TCKMinguoChronology.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_yearOfEra") public void test_resolve_yearOfEra(ResolverStyle style, Integer e, Integer yoe, Integer y, ChronoField field, Integer expected) { Map<TemporalField, Long> fieldValues = new HashMap<>(); if (e != null) { fieldValues.put(ChronoField.ERA, (long) e); } if (yoe != null) { fieldValues.put(ChronoField.YEAR_OF_ERA, (long) yoe); } if (y != null) { fieldValues.put(ChronoField.YEAR, (long) y); } if (field != null) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, style); assertEquals(date, null); assertEquals(fieldValues.get(field), (Long) expected.longValue()); assertEquals(fieldValues.size(), 1); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, style); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #18
Source File: TCKMinguoChronology.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
@Test(dataProvider = "resolve_ymaa") public void test_resolve_ymaa_strict(int y, int m, int w, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.ALIGNED_WEEK_OF_MONTH, (long) w); fieldValues.put(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH, (long) d); if (strict) { MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); } else { try { MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.STRICT); fail("Should have failed"); } catch (DateTimeException ex) { // expected } } }
Example #19
Source File: TCKMinguoChronology.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test public void test_periodUntilUnit() { MinguoDate mdate1 = MinguoDate.of(1970, 1, 1); MinguoDate mdate2 = MinguoDate.of(1971, 2, 2); long months = mdate1.until(mdate2, ChronoUnit.MONTHS); assertEquals(months, 13); }
Example #20
Source File: TCKMinguoChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test() public void test_MinguoChrono() { MinguoDate h1 = MinguoChronology.INSTANCE.date(MinguoEra.ROC, 1, 2, 3); MinguoDate h2 = h1; ChronoLocalDateTime<MinguoDate> h3 = h2.atTime(LocalTime.NOON); @SuppressWarnings("unused") ChronoZonedDateTime<MinguoDate> h4 = h3.atZone(ZoneOffset.UTC); }
Example #21
Source File: TCKMinguoChronology.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_periodUntilDate() { MinguoDate mdate1 = MinguoDate.of(1970, 1, 1); MinguoDate mdate2 = MinguoDate.of(1971, 2, 2); ChronoPeriod period = mdate1.until(mdate2); assertEquals(period, MinguoChronology.INSTANCE.period(1, 1, 1)); }
Example #22
Source File: TCKMinguoChronology.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Test public void test_Instant_zonedDateTime() { OffsetDateTime offsetDateTime = OffsetDateTime.of(2012, 2, 29, 2, 7, 1, 1, OFFSET_PTWO); ZonedDateTime zonedDateTime = ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_PARIS); ChronoZonedDateTime<MinguoDate> result = MinguoChronology.INSTANCE.zonedDateTime(offsetDateTime.toInstant(), offsetDateTime.getOffset()); assertEquals(result.toLocalDate(), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29)); assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1)); result = MinguoChronology.INSTANCE.zonedDateTime(zonedDateTime.toInstant(), zonedDateTime.getOffset()); assertEquals(result.toLocalDate(), MinguoChronology.INSTANCE.date(MinguoEra.ROC, 2012 - YDIFF, 2, 29)); assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1)); }
Example #23
Source File: TCKMinguoChronology.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Test public void test_periodUntilDate() { MinguoDate mdate1 = MinguoDate.of(1970, 1, 1); MinguoDate mdate2 = MinguoDate.of(1971, 2, 2); ChronoPeriod period = mdate1.until(mdate2); assertEquals(period, MinguoChronology.INSTANCE.period(1, 1, 1)); }
Example #24
Source File: TestTextParserWithLocale.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="parseChronoLocalDate") Object[][] provider_chronoLocalDate() { return new Object[][] { { HijrahDate.now() }, { JapaneseDate.now() }, { MinguoDate.now() }, { ThaiBuddhistDate.now() }}; }
Example #25
Source File: TCKMinguoChronology.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Test(dataProvider = "resolve_ymaa") public void test_resolve_ymaa_lenient(int y, int m, int w, int d, MinguoDate expected, boolean smart, boolean strict) { Map<TemporalField, Long> fieldValues = new HashMap<>(); fieldValues.put(ChronoField.YEAR, (long) y); fieldValues.put(ChronoField.MONTH_OF_YEAR, (long) m); fieldValues.put(ChronoField.ALIGNED_WEEK_OF_MONTH, (long) w); fieldValues.put(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH, (long) d); MinguoDate date = MinguoChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.LENIENT); assertEquals(date, expected); assertEquals(fieldValues.size(), 0); }
Example #26
Source File: TCKDateTimeParseResolver.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_fieldResolvesToChronoZonedDateTime_overrideChrono_matches() { MinguoDate mdt = MinguoDate.of(100, 6, 30); ChronoZonedDateTime<MinguoDate> mzdt = mdt.atTime(LocalTime.NOON).atZone(EUROPE_PARIS); DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(new ResolvingField(mzdt)).toFormatter(); f = f.withChronology(MinguoChronology.INSTANCE); TemporalAccessor accessor = f.parse("1234567890"); assertEquals(accessor.query(TemporalQueries.localDate()), LocalDate.from(mdt)); assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.NOON); assertEquals(accessor.query(TemporalQueries.chronology()), MinguoChronology.INSTANCE); assertEquals(accessor.query(TemporalQueries.zoneId()), EUROPE_PARIS); }
Example #27
Source File: TCKDateTimeParseResolver.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test public void test_fieldResolvesToChronoLocalDateTime_overrideChrono_matches() { MinguoDate mdt = MinguoDate.of(100, 6, 30); DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(new ResolvingField(mdt.atTime(LocalTime.NOON))).toFormatter(); f = f.withChronology(MinguoChronology.INSTANCE); TemporalAccessor accessor = f.parse("1234567890"); assertEquals(accessor.query(TemporalQueries.localDate()), LocalDate.from(mdt)); assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.NOON); assertEquals(accessor.query(TemporalQueries.chronology()), MinguoChronology.INSTANCE); }
Example #28
Source File: TCKMinguoChronology.java From hottub with GNU General Public License v2.0 | 5 votes |
@Test() public void test_MinguoChrono() { MinguoDate h1 = MinguoChronology.INSTANCE.date(MinguoEra.ROC, 1, 2, 3); MinguoDate h2 = h1; ChronoLocalDateTime<MinguoDate> h3 = h2.atTime(LocalTime.NOON); @SuppressWarnings("unused") ChronoZonedDateTime<MinguoDate> h4 = h3.atZone(ZoneOffset.UTC); }
Example #29
Source File: TCKChronoLocalDateSerialization.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@DataProvider(name = "calendars") Object[][] data_of_calendars() { return new Object[][]{ {JapaneseDate.of(JapaneseEra.HEISEI, 25, 01, 05), JAPANESE_DATE_TYPE}, {MinguoDate.of(102, 01, 05), MINGUO_DATE_TYPE}, {ThaiBuddhistDate.of(2556, 01, 05), THAIBUDDHIST_DATE_TYPE}, }; }
Example #30
Source File: TCKChronoLocalDateSerialization.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@DataProvider(name = "invalidSerialformClasses") Object[][] invalid_serial_classes() { return new Object[][]{ {JapaneseEra.class}, {JapaneseDate.class}, {MinguoDate.class}, {ThaiBuddhistDate.class}, {HijrahDate.class}, }; }