use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_with_adjustment.
//-----------------------------------------------------------------------
// with()
//-----------------------------------------------------------------------
@Test
public void test_with_adjustment() {
final LocalDateTime sample = LocalDateTime.of(2012, 3, 4, 23, 5);
TemporalAdjuster adjuster = new TemporalAdjuster() {
@Override
public Temporal adjustInto(Temporal dateTime) {
return sample;
}
};
assertEquals(TEST_2007_07_15_12_30_40_987654321.with(adjuster), sample);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_plusMonths_int_normal.
//-----------------------------------------------------------------------
// plusMonths()
//-----------------------------------------------------------------------
@Test
public void test_plusMonths_int_normal() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusMonths(1);
check(t, 2007, 8, 15, 12, 30, 40, 987654321);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_atZone_Offset.
@Test
public void test_atZone_Offset() {
LocalDateTime t = LocalDateTime.of(2008, 6, 30, 11, 30);
assertEquals(t.atZone(OFFSET_PTWO), ZonedDateTime.of(LocalDateTime.of(2008, 6, 30, 11, 30), OFFSET_PTWO));
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method factory_of_5ints.
//-----------------------------------------------------------------------
@Test
public void factory_of_5ints() {
LocalDateTime dateTime = LocalDateTime.of(2007, 7, 15, 12, 30);
check(dateTime, 2007, 7, 15, 12, 30, 0, 0);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_plusNanos_noChange_oneDay.
@Test
public void test_plusNanos_noChange_oneDay() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusNanos(24 * 60 * 60 * 1000000000L);
assertEquals(t.toLocalDate(), TEST_2007_07_15_12_30_40_987654321.toLocalDate().plusDays(1));
}
Aggregations