use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createYmd.
@Test(dataProvider = "createByProleptic")
public void test_createYmd(int y, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.date(y, moy, dom);
JapaneseDate dateByDateFactory = JapaneseDate.of(y, 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_resolve_ymd_lenient.
@Test(dataProvider = "resolve_ymd")
public void test_resolve_ymd_lenient(int y, int m, int d, JapaneseDate expected, Object 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.DAY_OF_MONTH, (long) d);
JapaneseDate date = JapaneseChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.LENIENT);
assertEquals(date, expected);
assertEquals(fieldValues.size(), 0);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_resolve_yd_lenient.
@Test(dataProvider = "resolve_yd")
public void test_resolve_yd_lenient(int y, int d, JapaneseDate expected, boolean smart, boolean strict) {
Map<TemporalField, Long> fieldValues = new HashMap<>();
fieldValues.put(ChronoField.YEAR, (long) y);
fieldValues.put(ChronoField.DAY_OF_YEAR, (long) d);
JapaneseDate date = JapaneseChronology.INSTANCE.resolveDate(fieldValues, ResolverStyle.LENIENT);
assertEquals(date, expected);
assertEquals(fieldValues.size(), 0);
}
use of java.time.chrono.JapaneseDate in project jdk8u_jdk by JetBrains.
the class TCKJapaneseChronology method test_createYd.
@Test(dataProvider = "createByProleptic")
public void test_createYd(int y, int moy, int dom, int doy, LocalDate iso) {
JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.dateYearDay(y, doy);
JapaneseDate dateByDateFactory = JapaneseDate.of(y, 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_resolve_yearOfEra_yearOfEraOnly_valid.
@Test(dataProvider = "resolve_styles")
public void test_resolve_yearOfEra_yearOfEraOnly_valid(ResolverStyle style) {
Map<TemporalField, Long> fieldValues = new HashMap<>();
fieldValues.put(ChronoField.YEAR_OF_ERA, 1L);
JapaneseDate date = JapaneseChronology.INSTANCE.resolveDate(fieldValues, style);
assertEquals(date, null);
assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), (Long) 1L);
assertEquals(fieldValues.size(), 1);
}
Aggregations