Search in sources :

Example 81 with Clock

use of java.time.Clock in project j2objc by google.

the class TCKClock_Tick method test_tick_ClockDuration_250micros.

public void test_tick_ClockDuration_250micros() {
    for (int i = 0; i < 1000; i++) {
        Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000).toInstant(), PARIS), Duration.ofNanos(250_000));
        assertEquals(test.instant(), ZDT.withNano((i / 250) * 250_000).toInstant());
        assertEquals(test.getZone(), PARIS);
    }
}
Also used : Clock(java.time.Clock)

Example 82 with Clock

use of java.time.Clock in project j2objc by google.

the class TestClock_Fixed method test_withZone_same.

// -------------------------------------------------------------------------
@Test
public void test_withZone_same() {
    Clock test = Clock.fixed(INSTANT, PARIS);
    Clock changed = test.withZone(PARIS);
    assertSame(test, changed);
}
Also used : Clock(java.time.Clock) Test(org.junit.Test)

Example 83 with Clock

use of java.time.Clock in project j2objc by google.

the class TestClock_Fixed method test_toString.

// -----------------------------------------------------------------------
@Test
public void test_toString() {
    Clock test = Clock.fixed(INSTANT, PARIS);
    assertEquals(test.toString(), "FixedClock[2008-06-30T09:30:10.000000500Z,Europe/Paris]");
}
Also used : Clock(java.time.Clock) Test(org.junit.Test)

Example 84 with Clock

use of java.time.Clock in project j2objc by google.

the class TestClock_System method test_toString.

@Test
public // -----------------------------------------------------------------------
void test_toString() {
    Clock test = Clock.system(PARIS);
    assertEquals(test.toString(), "SystemClock[Europe/Paris]");
}
Also used : Clock(java.time.Clock) Test(org.junit.Test)

Example 85 with Clock

use of java.time.Clock in project j2objc by google.

the class TestClock_System method test_withZone_same.

@Test
public void test_withZone_same() {
    Clock test = Clock.system(PARIS);
    Clock changed = test.withZone(PARIS);
    assertSame(test, changed);
}
Also used : Clock(java.time.Clock) Test(org.junit.Test)

Aggregations

Clock (java.time.Clock)209 Test (org.junit.Test)62 Instant (java.time.Instant)51 Test (org.testng.annotations.Test)43 LocalTime (java.time.LocalTime)15 ZonedDateTime (java.time.ZonedDateTime)12 LocalDateTime (java.time.LocalDateTime)11 ZoneId (java.time.ZoneId)11 LocalDate (java.time.LocalDate)10 OffsetDateTime (java.time.OffsetDateTime)8 Test (org.junit.jupiter.api.Test)7 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)6 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)6 IOException (java.io.IOException)6 SessionTest (com.yahoo.vespa.config.server.session.SessionTest)5 OffsetTime (java.time.OffsetTime)5 ZoneOffset (java.time.ZoneOffset)5 Chronology (java.time.chrono.Chronology)5 IsoChronology (java.time.chrono.IsoChronology)5 Date (java.util.Date)4