Пример #1
0
 @Test
 public void testWithYearInvalidTooBig() throws Exception {
   try {
     testDate.withYear(testEra, 10000);
     fail();
   } catch (IllegalCalendarFieldValueException ex) {
     assertEquals(ex.getRule(), MinguoChronology.yearOfEraRule());
   }
 }
Пример #2
0
 // -----------------------------------------------------------------------
 // withYearOfEra()
 // -----------------------------------------------------------------------
 @Test
 public void testWithYear() {
   MinguoDate date = testDate.withYear(MinguoEra.BEFORE_MINGUO, 100);
   assertEquals(
       date, MinguoDate.of(MinguoEra.BEFORE_MINGUO, 100, testMonthOfYear, testDayOfMonth));
 }