use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKChronology method test_dateEpochDay.
@Test(dataProvider = "calendarNameAndType")
public void test_dateEpochDay(String name, String alias) {
Chronology chrono = Chronology.of(name);
ChronoLocalDate date = chrono.dateNow();
long epochDay = date.getLong(ChronoField.EPOCH_DAY);
ChronoLocalDate test = chrono.dateEpochDay(epochDay);
assertEquals(test, date);
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKChronology method test_HijrahChronology_dateYearDay.
//-----------------------------------------------------------------------
// dateYearDay() and date()
//-----------------------------------------------------------------------
@Test
public void test_HijrahChronology_dateYearDay() {
Chronology chrono = Chronology.of("Hijrah");
ChronoLocalDate date1 = chrono.dateYearDay(HijrahEra.AH, 1434, 178);
ChronoLocalDate date2 = chrono.date(HijrahEra.AH, 1434, 7, 1);
assertEquals(date1, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
assertEquals(date2, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKChronology method test_getDisplayName.
@Test(dataProvider = "calendarDisplayName")
public void test_getDisplayName(String chronoId, String calendarDisplayName) {
Chronology chrono = Chronology.of(chronoId);
assertEquals(chrono.getDisplayName(TextStyle.FULL, Locale.ENGLISH), calendarDisplayName);
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKChronology method test_JapaneseChronology_dateYearDay.
@Test
public void test_JapaneseChronology_dateYearDay() {
Chronology chrono = Chronology.of("Japanese");
ChronoLocalDate date1 = chrono.dateYearDay(JapaneseEra.HEISEI, 8, 60);
ChronoLocalDate date2 = chrono.date(JapaneseEra.HEISEI, 8, 2, 29);
assertEquals(date1, JapaneseChronology.INSTANCE.dateYearDay(JapaneseEra.HEISEI, 8, 60));
assertEquals(date2, JapaneseChronology.INSTANCE.dateYearDay(JapaneseEra.HEISEI, 8, 60));
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKChronology method test_ThaiBuddhistChronology_dateNow.
@Test
public void test_ThaiBuddhistChronology_dateNow() {
ZoneId zoneId_paris = ZoneId.of("Europe/Paris");
Clock clock = Clock.system(zoneId_paris);
Chronology chrono = Chronology.of("ThaiBuddhist");
assertEquals(chrono.dateNow(), ThaiBuddhistChronology.INSTANCE.dateNow());
assertEquals(chrono.dateNow(zoneId_paris), ThaiBuddhistChronology.INSTANCE.dateNow(zoneId_paris));
assertEquals(chrono.dateNow(clock), ThaiBuddhistChronology.INSTANCE.dateNow(clock));
}
Aggregations