Search in sources :

Example 51 with Duration

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);
}
Also used : Duration(java.time.Duration) Test(org.testng.annotations.Test)

Example 52 with Duration

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);
}
Also used : Duration(java.time.Duration) Test(org.testng.annotations.Test)

Example 53 with Duration

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);
}
Also used : Duration(java.time.Duration) Test(org.testng.annotations.Test)

Example 54 with Duration

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);
}
Also used : Duration(java.time.Duration) Test(org.testng.annotations.Test)

Example 55 with Duration

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);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Duration(java.time.Duration) Test(org.testng.annotations.Test)

Aggregations

Duration (java.time.Duration)195 Test (org.testng.annotations.Test)135 Instant (java.time.Instant)17 Test (org.junit.Test)16 List (java.util.List)6 Map (java.util.Map)4 ZonedDateTime (java.time.ZonedDateTime)3 ArrayList (java.util.ArrayList)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 ReplSetHeartbeatReply (com.torodb.mongodb.commands.signatures.internal.ReplSetHeartbeatReply)2 LocalDateTime (java.time.LocalDateTime)2 OffsetDateTime (java.time.OffsetDateTime)2 ZoneId (java.time.ZoneId)2 DateTimeFormatter (java.time.format.DateTimeFormatter)2 Iterator (java.util.Iterator)2 Optional (java.util.Optional)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)2 Collectors (java.util.stream.Collectors)2 Edge (org.apache.tinkerpop.gremlin.structure.Edge)2 JSONLexer (com.alibaba.fastjson.parser.JSONLexer)1