Search in sources :

Example 61 with Duration

use of java.time.Duration in project jdk8u_jdk by JetBrains.

the class TestDuration method plusNanos_zeroReturnsThis.

@Test
public void plusNanos_zeroReturnsThis() {
    Duration t = Duration.ofSeconds(-1, 2000000);
    assertSame(t.plusNanos(0), t);
}
Also used : Duration(java.time.Duration) Test(org.testng.annotations.Test)

Example 62 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 63 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 64 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 65 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)

Aggregations

Duration (java.time.Duration)262 Test (org.testng.annotations.Test)135 Test (org.junit.Test)32 Instant (java.time.Instant)27 ArrayList (java.util.ArrayList)15 CompletableFuture (java.util.concurrent.CompletableFuture)15 Preconditions (com.google.common.base.Preconditions)14 Exceptions (io.pravega.common.Exceptions)13 List (java.util.List)13 CompletionException (java.util.concurrent.CompletionException)13 AtomicReference (java.util.concurrent.atomic.AtomicReference)13 TimeoutTimer (io.pravega.common.TimeoutTimer)12 Futures (io.pravega.common.concurrent.Futures)12 SegmentProperties (io.pravega.segmentstore.contracts.SegmentProperties)11 StreamSegmentNotExistsException (io.pravega.segmentstore.contracts.StreamSegmentNotExistsException)11 Storage (io.pravega.segmentstore.storage.Storage)11 LoggerHelpers (io.pravega.common.LoggerHelpers)10 ZonedDateTime (java.time.ZonedDateTime)10 Executor (java.util.concurrent.Executor)10 Slf4j (lombok.extern.slf4j.Slf4j)10