use of java.time.chrono.ThaiBuddhistDate in project jdk8u_jdk by JetBrains.
the class TCKThaiBuddhistChronology method test_withYear_BE.
//-----------------------------------------------------------------------
// withYear()
//-----------------------------------------------------------------------
@Test
public void test_withYear_BE() {
ThaiBuddhistDate base = ThaiBuddhistChronology.INSTANCE.date(2555, 8, 29);
ThaiBuddhistDate test = base.with(YEAR, 2554);
assertEquals(test, ThaiBuddhistChronology.INSTANCE.date(2554, 8, 29));
}
use of java.time.chrono.ThaiBuddhistDate in project jdk8u_jdk by JetBrains.
the class TCKThaiBuddhistChronology method test_resolve_ymaa_lenient.
@Test(dataProvider = "resolve_ymaa")
public void test_resolve_ymaa_lenient(int y, int m, int w, int d, ThaiBuddhistDate 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);
ThaiBuddhistDate date = ThaiBuddhistChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.LENIENT);
assertEquals(date, expected);
assertEquals(fieldValues.size(), 0);
}
use of java.time.chrono.ThaiBuddhistDate in project jdk8u_jdk by JetBrains.
the class TCKThaiBuddhistChronology method test_withEra_swap.
@Test
public void test_withEra_swap() {
ThaiBuddhistDate base = ThaiBuddhistChronology.INSTANCE.date(-2554, 8, 29);
ThaiBuddhistDate test = base.with(ChronoField.ERA, ThaiBuddhistEra.BE.getValue());
assertEquals(test, ThaiBuddhistChronology.INSTANCE.date(2555, 8, 29));
}
use of java.time.chrono.ThaiBuddhistDate in project jdk8u_jdk by JetBrains.
the class TCKMinguoChronology method test_periodUntilDiffChrono.
@Test
public void test_periodUntilDiffChrono() {
MinguoDate mdate1 = MinguoDate.of(1970, 1, 1);
MinguoDate mdate2 = MinguoDate.of(1971, 2, 2);
ThaiBuddhistDate ldate2 = ThaiBuddhistChronology.INSTANCE.date(mdate2);
ChronoPeriod period = mdate1.until(ldate2);
assertEquals(period, MinguoChronology.INSTANCE.period(1, 1, 1));
}
use of java.time.chrono.ThaiBuddhistDate in project jdk8u_jdk by JetBrains.
the class TCKThaiBuddhistChronology method test_withYear_BBE.
@Test
public void test_withYear_BBE() {
ThaiBuddhistDate base = ThaiBuddhistChronology.INSTANCE.date(-2554, 8, 29);
ThaiBuddhistDate test = base.with(YEAR_OF_ERA, 2554);
assertEquals(test, ThaiBuddhistChronology.INSTANCE.date(-2553, 8, 29));
}
Aggregations