use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createEyd.
@Test(dataProvider = "createByEra")
public void test_createEyd(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.dateYearDay(era, yoe, doy);
JapaneseDate dateByDateFactory = JapaneseDate.of(era, yoe, moy, dom);
assertEquals(dateByChronoFactory, dateByDateFactory);
assertEquals(dateByChronoFactory.hashCode(), dateByDateFactory.hashCode());
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createByEra_chronologyTemporalFactory.
@Test(dataProvider = "createByEra")
public void test_createByEra_chronologyTemporalFactory(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate test = JapaneseDate.of(era, yoe, moy, dom);
assertEquals(IsoChronology.INSTANCE.date(test), iso);
assertEquals(JapaneseChronology.INSTANCE.date(iso), test);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createEymd.
@Test(dataProvider = "createByEra")
public void test_createEymd(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.date(era, yoe, moy, dom);
JapaneseDate dateByDateFactory = JapaneseDate.of(era, yoe, moy, dom);
assertEquals(dateByChronoFactory, dateByDateFactory);
assertEquals(dateByChronoFactory.hashCode(), dateByDateFactory.hashCode());
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_getLong.
//-----------------------------------------------------------------------
// get(TemporalField)
//-----------------------------------------------------------------------
@Test
public void test_getLong() {
JapaneseDate base = JapaneseChronology.INSTANCE.date(JapaneseEra.SHOWA, 63, 6, 30);
assertEquals(base.getLong(ERA), JapaneseEra.SHOWA.getValue());
assertEquals(base.getLong(YEAR), 1988L);
assertEquals(base.getLong(YEAR_OF_ERA), 63L);
assertEquals(base.getLong(MONTH_OF_YEAR), 6L);
assertEquals(base.getLong(DAY_OF_MONTH), 30L);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_periodUntilUnit.
@Test
public void test_periodUntilUnit() {
JapaneseDate mdate1 = JapaneseDate.of(1970, 1, 1);
JapaneseDate mdate2 = JapaneseDate.of(1971, 2, 2);
long months = mdate1.until(mdate2, ChronoUnit.MONTHS);
assertEquals(months, 13);
}
Aggregations