use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_withHour_toMidday.
@Test
public void test_withHour_toMidday() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(1, 0)).withHour(12);
assertSame(t.toLocalTime(), LocalTime.NOON);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_comparisons_LocalDateTime.
void test_comparisons_LocalDateTime(LocalDate[] localDates, LocalTime... localTimes) {
LocalDateTime[] localDateTimes = new LocalDateTime[localDates.length * localTimes.length];
int i = 0;
for (LocalDate localDate : localDates) {
for (LocalTime localTime : localTimes) {
localDateTimes[i++] = LocalDateTime.of(localDate, localTime);
}
}
doTest_comparisons_LocalDateTime(localDateTimes);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_minusHours_toMidday.
@Test
public void test_minusHours_toMidday() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(13, 0)).minusHours(1);
assertSame(t.toLocalTime(), LocalTime.NOON);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_minusNanos_toMidnight.
@Test
public void test_minusNanos_toMidnight() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(0, 0, 0, 1)).minusNanos(1);
assertSame(t.toLocalTime(), LocalTime.MIDNIGHT);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_plusNanos_toMidday.
@Test
public void test_plusNanos_toMidday() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(11, 59, 59, 999999999)).plusNanos(1);
assertSame(t.toLocalTime(), LocalTime.NOON);
}
Aggregations