use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_withDayOfYear_noChange.
@Test
public void test_withDayOfYear_noChange() {
LocalDateTime ldt = LocalDateTime.of(2008, 2, 5, 23, 30, 59, 0);
ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
ZonedDateTime test = base.withDayOfYear(36);
assertEquals(test, base);
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_equals_false_offset_differs.
@Test(dataProvider = "sampleTimes")
public void test_equals_false_offset_differs(int y, int o, int d, int h, int m, int s, int n, ZoneId ignored) {
ZonedDateTime a = ZonedDateTime.of(dateTime(y, o, d, h, m, s, n), ZONE_0100);
ZonedDateTime b = ZonedDateTime.of(dateTime(y, o, d, h, m, s, n), ZONE_0200);
assertEquals(a.equals(b), false);
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_compareTo_offset1.
@Test
public void test_compareTo_offset1() {
ZonedDateTime a = ZonedDateTime.of(2008, 6, 30, 11, 30, 41, 0, ZONE_0200);
// a is before b due to offset
ZonedDateTime b = ZonedDateTime.of(2008, 6, 30, 11, 30, 39, 0, ZONE_0100);
assertEquals(a.compareTo(b) < 0, true);
assertEquals(b.compareTo(a) > 0, true);
assertEquals(a.compareTo(a) == 0, true);
assertEquals(b.compareTo(b) == 0, true);
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_minusWeeks.
//-----------------------------------------------------------------------
// minusWeeks()
//-----------------------------------------------------------------------
@Test
public void test_minusWeeks() {
LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 23, 30, 59, 0);
ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
ZonedDateTime test = base.minusWeeks(1);
assertEquals(test, ZonedDateTime.of(ldt.minusWeeks(1), ZONE_0100));
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method factory_ofStrict_LDT_ZI_ZO.
//-----------------------------------------------------------------------
// ofStrict(LocalDateTime, ZoneId, ZoneOffset)
//-----------------------------------------------------------------------
@Test
public void factory_ofStrict_LDT_ZI_ZO() {
LocalDateTime normal = LocalDateTime.of(2008, 6, 30, 11, 30, 10, 500);
ZonedDateTime test = ZonedDateTime.ofStrict(normal, OFFSET_0200, ZONE_PARIS);
check(test, 2008, 6, 30, 11, 30, 10, 500, OFFSET_0200, ZONE_PARIS);
}
Aggregations