use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_atTime_int_int_int.
@Test
public void test_atTime_int_int_int() {
LocalDate t = LocalDate.of(2008, 6, 30);
assertEquals(t.atTime(11, 30, 40), LocalDateTime.of(2008, 6, 30, 11, 30, 40));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_with_adjustment.
//-----------------------------------------------------------------------
// with()
//-----------------------------------------------------------------------
@Test
public void test_with_adjustment() {
final LocalDate sample = LocalDate.of(2012, 3, 4);
TemporalAdjuster adjuster = new TemporalAdjuster() {
@Override
public Temporal adjustInto(Temporal dateTime) {
return sample;
}
};
assertEquals(TEST_2007_07_15.with(adjuster), sample);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusWeeks_overLeapYears.
@Test
public void test_minusWeeks_overLeapYears() {
LocalDate t = TEST_2007_07_15.minusYears(-1).minusWeeks(104);
assertEquals(t, LocalDate.of(2006, 7, 18));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_atTime_int_int_hourTooSmall.
@Test(expectedExceptions = DateTimeException.class)
public void test_atTime_int_int_hourTooSmall() {
LocalDate t = LocalDate.of(2008, 6, 30);
t.atTime(-1, 30);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusMonths_long_big.
@Test
public void test_minusMonths_long_big() {
long months = 20L + Integer.MAX_VALUE;
LocalDate test = LocalDate.of(40, 6, 1).minusMonths(months);
assertEquals(test, LocalDate.of((int) (40L - months / 12), 6 - (int) (months % 12), 1));
}
Aggregations