use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_atOffset.
//-----------------------------------------------------------------------
// atOffset()
//-----------------------------------------------------------------------
@Test
public void test_atOffset() {
LocalDateTime t = LocalDateTime.of(2008, 6, 30, 11, 30);
assertEquals(t.atOffset(OFFSET_PTWO), OffsetDateTime.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 test_atOffset_nullZoneOffset.
@Test(expectedExceptions = NullPointerException.class)
public void test_atOffset_nullZoneOffset() {
LocalDateTime t = LocalDateTime.of(2008, 6, 30, 11, 30);
t.atOffset((ZoneOffset) null);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_plusDays_overLeapYears.
@Test
public void test_plusDays_overLeapYears() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusYears(-1).plusDays(365 + 366);
check(t, 2008, 7, 15, 12, 30, 40, 987654321);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_equals_false_day_differs.
@Test(dataProvider = "sampleDateTimes")
public void test_equals_false_day_differs(int y, int m, int d, int h, int mi, int s, int n) {
LocalDateTime a = LocalDateTime.of(y, m, d, h, mi, s, n);
LocalDateTime b = LocalDateTime.of(y, m, d + 1, h, mi, s, n);
assertFalse(a.equals(b));
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_minusDays_normal.
@Test
public void test_minusDays_normal() {
LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minusDays(1);
check(t, 2007, 7, 14, 12, 30, 40, 987654321);
}
Aggregations