use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plus_Period_negativeDays.
@Test
public void test_plus_Period_negativeDays() {
MockSimplePeriod period = MockSimplePeriod.of(-25, ChronoUnit.DAYS);
LocalDate t = TEST_2007_07_15.plus(period);
assertEquals(t, LocalDate.of(2007, 6, 20));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusMonths_long_adjustDayFromMonthLength.
@Test
public void test_plusMonths_long_adjustDayFromMonthLength() {
LocalDate t = LocalDate.of(2007, 3, 31).plusMonths(1);
LocalDate expected = LocalDate.of(2007, 4, 30);
assertEquals(t, expected);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusWeeks_overLeapYears.
@Test
public void test_plusWeeks_overLeapYears() {
LocalDate t = TEST_2007_07_15.plusYears(-1).plusWeeks(104);
assertEquals(t, LocalDate.of(2008, 7, 12));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_atTime_int_int_int_minuteTooSmall.
@Test(expectedExceptions = DateTimeException.class)
public void test_atTime_int_int_int_minuteTooSmall() {
LocalDate t = LocalDate.of(2008, 6, 30);
t.atTime(11, -1, 40);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusYears_long_big.
@Test
public void test_minusYears_long_big() {
long years = 20L + Year.MAX_VALUE;
LocalDate test = LocalDate.of(40, 6, 1).minusYears(years);
assertEquals(test, LocalDate.of((int) (40L - years), 6, 1));
}
Aggregations