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);
}
}
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);
}
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]");
}
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]");
}
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);
}
Aggregations