use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createByEra_isEqual.
@Test(dataProvider = "createByEra")
public void test_createByEra_isEqual(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate test = JapaneseDate.of(era, yoe, moy, dom);
assertEquals(test.isEqual(iso), true);
assertEquals(iso.isEqual(test), true);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_adjust_toMonth.
@Test(expectedExceptions = DateTimeException.class)
public void test_adjust_toMonth() {
JapaneseDate jdate = JapaneseChronology.INSTANCE.date(1926, 1, 4);
jdate.with(Month.APRIL);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_resolve_yearOfEra_yearOfEraAndYearOnly_valid.
@Test(dataProvider = "resolve_styles")
public void test_resolve_yearOfEra_yearOfEraAndYearOnly_valid(ResolverStyle style) {
Map<TemporalField, Long> fieldValues = new HashMap<>();
fieldValues.put(ChronoField.YEAR_OF_ERA, 1L);
fieldValues.put(ChronoField.YEAR, 2012L);
JapaneseDate date = JapaneseChronology.INSTANCE.resolveDate(fieldValues, style);
assertEquals(date, null);
assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), (Long) 1L);
assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 2012L);
assertEquals(fieldValues.size(), 2);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_LocalDateTime_adjustToJapaneseDate.
@Test
public void test_LocalDateTime_adjustToJapaneseDate() {
JapaneseDate jdate = JapaneseChronology.INSTANCE.date(1928, 10, 29);
LocalDateTime test = LocalDateTime.MIN.with(jdate);
assertEquals(test, LocalDateTime.of(1928, 10, 29, 0, 0));
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createByEra_query.
@Test(dataProvider = "createByEra")
public void test_createByEra_query(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate test = JapaneseDate.of(era, yoe, moy, dom);
assertEquals(test.query(TemporalQueries.localDate()), iso);
}
Aggregations