use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_withMinute_normal.
//-----------------------------------------------------------------------
// withMinute()
//-----------------------------------------------------------------------
@Test
public void test_withMinute_normal() {
ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100);
ZonedDateTime test = base.withMinute(15);
assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withMinute(15), ZONE_0100));
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_withZoneSameInstant_null.
@Test(expectedExceptions = NullPointerException.class)
public void test_withZoneSameInstant_null() {
ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100);
base.withZoneSameInstant(null);
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_toString.
@Test(dataProvider = "sampleToString")
public void test_toString(int y, int o, int d, int h, int m, int s, int n, String zoneId, String expected) {
ZonedDateTime t = ZonedDateTime.of(dateTime(y, o, d, h, m, s, n), ZoneId.of(zoneId));
String str = t.toString();
assertEquals(str, expected);
}
use of java.time.ZonedDateTime in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_withZoneSameInstant_noChange.
@Test
public void test_withZoneSameInstant_noChange() {
ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100);
ZonedDateTime test = base.withZoneSameInstant(ZONE_0100);
assertEquals(test, base);
}
use of java.time.ZonedDateTime 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));
}
Aggregations