use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKChronology method test_IsoChronology_dateYearDay.
@Test
public void test_IsoChronology_dateYearDay() {
Chronology chrono = Chronology.of("ISO");
ChronoLocalDate date1 = chrono.dateYearDay(IsoEra.CE, 5, 60);
ChronoLocalDate date2 = chrono.date(IsoEra.CE, 5, 3, 1);
assertEquals(date1, IsoChronology.INSTANCE.dateYearDay(IsoEra.CE, 5, 60));
assertEquals(date2, IsoChronology.INSTANCE.dateYearDay(IsoEra.CE, 5, 60));
}
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));
}
Aggregations