use of java.time.Duration in project jdk8u_jdk by JetBrains.
the class TestDuration method minusNanos_zeroReturnsThis.
@Test
public void minusNanos_zeroReturnsThis() {
Duration t = Duration.ofSeconds(1, 2000000);
assertSame(t.minusNanos(0), t);
}
use of java.time.Duration in project jdk8u_jdk by JetBrains.
the class TestDuration method minus_zeroSingleton.
@Test
public void minus_zeroSingleton() {
Duration t = Duration.ofSeconds(1);
assertSame(t.minus(Duration.ofSeconds(1)), Duration.ZERO);
}
use of java.time.Duration in project jdk8u_jdk by JetBrains.
the class TestDuration method minus_zeroReturnsThis.
@Test
public void minus_zeroReturnsThis() {
Duration t = Duration.ofSeconds(1);
assertSame(t.minus(Duration.ZERO), t);
}
use of java.time.Duration in project jdk8u_jdk by JetBrains.
the class TestDuration method plusMillis_zeroReturnsThis.
@Test
public void plusMillis_zeroReturnsThis() {
Duration t = Duration.ofSeconds(-1, 2000000);
assertSame(t.plusMillis(0), t);
}
use of java.time.Duration in project jdk8u_jdk by JetBrains.
the class TCKZonedDateTime method test_plus_TemporalAmount_Duration.
@Test
public void test_plus_TemporalAmount_Duration() {
Duration duration = Duration.ofSeconds(4L * 60 * 60 + 5L * 60 + 6L);
ZonedDateTime t = ZonedDateTime.of(LocalDateTime.of(2008, 6, 1, 12, 30, 59, 500), ZONE_0100);
ZonedDateTime expected = ZonedDateTime.of(LocalDateTime.of(2008, 6, 1, 16, 36, 5, 500), ZONE_0100);
assertEquals(t.plus(duration), expected);
}
Aggregations