use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_withNanoOfSecond_toMidnight.
@Test
public void test_withNanoOfSecond_toMidnight() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(0, 0, 0, 1)).withNano(0);
assertSame(t.toLocalTime(), LocalTime.MIDNIGHT);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_minus_adjuster_zero.
@Test
public void test_minus_adjuster_zero() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minus(Period.ZERO);
assertSame(t, TEST_2007_07_15_12_30_40_987654321);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_withNanoOfSecond_toMidday.
@Test
public void test_withNanoOfSecond_toMidday() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(12, 0, 0, 1)).withNano(0);
assertSame(t.toLocalTime(), LocalTime.NOON);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_minus_Period_zero.
@Test
public void test_minus_Period_zero() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minus(MockSimplePeriod.ZERO_DAYS);
assertSame(t, TEST_2007_07_15_12_30_40_987654321);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method now_Clock_minYear.
@Test
public void now_Clock_minYear() {
Clock clock = Clock.fixed(MIN_INSTANT, ZoneOffset.UTC);
LocalDateTime test = LocalDateTime.now(clock);
assertEquals(test, MIN_DATE_TIME);
}
Aggregations