use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_minusSeconds_toMidnight.
@Test
public void test_minusSeconds_toMidnight() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.of(0, 0, 1)).minusSeconds(1);
assertSame(t.toLocalTime(), LocalTime.MIDNIGHT);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_getTime.
//-----------------------------------------------------------------------
// toLocalTime()
//-----------------------------------------------------------------------
@Test(dataProvider = "sampleTimes")
public void test_getTime(int h, int m, int s, int ns) {
LocalTime t = LocalTime.of(h, m, s, ns);
LocalDateTime dt = LocalDateTime.of(LocalDate.of(2011, 7, 30), t);
assertSame(dt.toLocalTime(), t);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TestLocalDateTime method test_plusHours_noChange.
@Test
public void test_plusHours_noChange() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusHours(0);
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_plusWeeks_noChange.
@Test
public void test_plusWeeks_noChange() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusWeeks(0);
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_withMinute_noChange.
@Test
public void test_withMinute_noChange() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.withMinute(30);
assertSame(t, TEST_2007_07_15_12_30_40_987654321);
}
Aggregations