use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_with_adjuster_Year.
@Test
public void test_with_adjuster_Year() {
LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 23, 30, 59, 0);
ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
ZonedDateTime test = base.with(Year.of(2007));
assertEquals(test, ZonedDateTime.of(ldt.withYear(2007), ZONE_0100));
}
use of java.time.LocalDateTime 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.LocalDateTime 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.LocalDateTime 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);
}
use of java.time.LocalDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_plusMonths.
//-----------------------------------------------------------------------
// plusMonths()
//-----------------------------------------------------------------------
@Test
public void test_plusMonths() {
LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 23, 30, 59, 0);
ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
ZonedDateTime test = base.plusMonths(1);
assertEquals(test, ZonedDateTime.of(ldt.plusMonths(1), ZONE_0100));
}
Aggregations