/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | TCKClock_Tick.java | 65 import java.time.Clock; 88 …Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000_000).toInstant(), PARIS), Duration.ofMil… in test_tick_ClockDuration_250millis() 96 …Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000).toInstant(), PARIS), Duration.ofNanos(2… in test_tick_ClockDuration_250micros() 104 … Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i).toInstant(), PARIS), Duration.ofNanos(20)); in test_tick_ClockDuration_20nanos() 111 Clock underlying = Clock.system(PARIS); in test_tick_ClockDuration_zeroDuration() 112 Clock test = Clock.tick(underlying, Duration.ZERO); in test_tick_ClockDuration_zeroDuration() 117 Clock underlying = Clock.system(PARIS); in test_tick_ClockDuration_1nsDuration() 118 Clock test = Clock.tick(underlying, Duration.ofNanos(1)); in test_tick_ClockDuration_1nsDuration() 124 Clock.tick(Clock.systemUTC(), Duration.ofSeconds(Long.MAX_VALUE)); in test_tick_ClockDuration_maxDuration() 129 Clock.tick(Clock.systemUTC(), Duration.ofSeconds(0, 123)); in test_tick_ClockDuration_subMilliNotDivisible_123ns() [all …]
|
D | TCKClock_Offset.java | 65 import java.time.Clock; 87 Clock test = Clock.offset(Clock.fixed(INSTANT, PARIS), OFFSET); in test_offset_ClockDuration() 95 Clock underlying = Clock.system(PARIS); in test_offset_ClockDuration_zeroDuration() 96 Clock test = Clock.offset(underlying, Duration.ZERO); in test_offset_ClockDuration_zeroDuration() 102 Clock.offset(null, Duration.ZERO); in test_offset_ClockDuration_nullClock() 107 Clock.offset(Clock.systemUTC(), null); in test_offset_ClockDuration_nullDuration() 112 Clock test = Clock.offset(Clock.system(PARIS), OFFSET); in test_withZone() 113 Clock changed = test.withZone(MOSCOW); in test_withZone() 119 Clock test = Clock.offset(Clock.system(PARIS), OFFSET); in test_withZone_equal() 120 Clock changed = test.withZone(PARIS); in test_withZone_equal() [all …]
|
D | TCKClock_System.java | 65 import java.time.Clock; 83 Clock system = Clock.systemUTC(); in test_instant() 97 Clock system = Clock.systemUTC(); in test_millis() 112 Clock test = Clock.systemUTC(); in test_systemUTC() 114 assertEquals(test, Clock.system(ZoneOffset.UTC)); in test_systemUTC() 118 Clock test = Clock.systemDefaultZone(); in test_systemDefaultZone() 120 assertEquals(test, Clock.system(ZoneId.systemDefault())); in test_systemDefaultZone() 124 Clock test = Clock.system(PARIS); in test_system_ZoneId() 130 Clock.system(null); in test_zoneId_nullZoneId() 135 Clock test = Clock.system(PARIS); in test_withZone() [all …]
|
D | TCKClock_Fixed.java | 65 import java.time.Clock; 85 Clock test = Clock.fixed(INSTANT, PARIS); in test_fixed_InstantZoneId() 93 Clock.fixed(null, PARIS); in test_fixed_InstantZoneId_nullInstant() 98 Clock.fixed(INSTANT, null); in test_fixed_InstantZoneId_nullZoneId() 103 Clock test = Clock.fixed(INSTANT, PARIS); in test_withZone() 104 Clock changed = test.withZone(MOSCOW); in test_withZone() 110 Clock test = Clock.fixed(INSTANT, PARIS); in test_withZone_equal() 111 Clock changed = test.withZone(PARIS); in test_withZone_equal() 117 Clock.fixed(INSTANT, PARIS).withZone(null); in test_withZone_null() 122 Clock a = Clock.fixed(INSTANT, ZoneOffset.UTC); in test_equals() [all …]
|
D | TCKClock.java | 64 import java.time.Clock; 76 static class MockInstantClock extends Clock { 96 public Clock withZone(ZoneId timeZone) { in withZone() 115 private static final Clock MOCK_INSTANT = new MockInstantClock(INSTANT.toEpochMilli(), ZONE); 128 Clock changed = MOCK_INSTANT.withZone(london); in test_mockInstantClock_withZone()
|
D | TCKMonthDay.java | 71 import java.time.Clock; 154 MonthDay expected = MonthDay.now(Clock.systemDefaultZone()); in now() 160 expected = MonthDay.now(Clock.systemDefaultZone()); in now() 177 MonthDay expected = MonthDay.now(Clock.system(zone)); in now_ZoneId() 183 expected = MonthDay.now(Clock.system(zone)); in now_ZoneId() 195 Clock clock = Clock.fixed(instant, ZoneOffset.UTC); in now_Clock() 203 MonthDay.now((Clock) null); in now_Clock_nullClock()
|
/libcore/ojluni/src/test/java/time/tck/java/time/serial/ |
D | TCKClockSerialization.java | 64 import java.time.Clock; 91 assertSerializable(Clock.systemUTC()); in test_systemClockSerializable() 92 assertSerializable(Clock.systemDefaultZone()); in test_systemClockSerializable() 93 assertSerializable(Clock.system(PARIS)); in test_systemClockSerializable() 98 assertSerializable(Clock.offset(Clock.system(PARIS), AMOUNT)); in test_offsetClockSerializable() 103 assertSerializable(Clock.tickSeconds(PARIS)); in test_tickClockSerializable() 104 assertSerializable(Clock.tickMinutes(MOSCOW)); in test_tickClockSerializable() 105 assertSerializable(Clock.tick(Clock.fixed(INSTANT, PARIS), AMOUNT)); in test_tickClockSerializable() 110 assertSerializable(Clock.fixed(INSTANT, ZoneOffset.UTC)); in test_fixedClockSerializable() 111 assertSerializable(Clock.fixed(INSTANT, PARIS)); in test_fixedClockSerializable()
|
/libcore/ojluni/src/main/java/java/time/ |
D | Clock.java | 139 public abstract class Clock implements InstantSource { class 159 public static Clock systemUTC() { in systemUTC() 182 public static Clock systemDefaultZone() { in systemDefaultZone() 201 public static Clock system(ZoneId zone) { in system() 230 public static Clock tickMillis(ZoneId zone) { in tickMillis() 254 public static Clock tickSeconds(ZoneId zone) { in tickSeconds() 277 public static Clock tickMinutes(ZoneId zone) { in tickMinutes() 312 public static Clock tick(Clock baseClock, Duration tickDuration) { in tick() 347 public static Clock fixed(Instant fixedInstant, ZoneId zone) { in fixed() 373 public static Clock offset(Clock baseClock, Duration offsetDuration) { in offset() [all …]
|
D | InstantSource.java | 27 import java.time.Clock.SourceClock; 28 import java.time.Clock.SystemInstantSource; 152 return Clock.tick(baseSource.withZone(ZoneOffset.UTC), tickDuration); in tick() 170 return Clock.fixed(fixedInstant, ZoneOffset.UTC); in fixed() 195 return Clock.offset(baseSource.withZone(ZoneOffset.UTC), offsetDuration); in offset() 250 default Clock withZone(ZoneId zone) { in withZone()
|
D | MonthDay.java | 161 return now(Clock.systemDefaultZone()); in now() 177 return now(Clock.system(zone)); in now() 190 public static MonthDay now(Clock clock) { in now()
|
/libcore/ojluni/src/test/java/time/test/java/time/ |
D | TestClock_Offset.java | 65 import java.time.Clock; 82 Clock test = Clock.offset(Clock.system(PARIS), OFFSET); in test_withZone_same() 83 Clock changed = test.withZone(PARIS); in test_withZone_same() 89 Clock test = Clock.offset(Clock.systemUTC(), OFFSET); in test_toString()
|
D | TestClock_Tick.java | 65 import java.time.Clock; 86 Clock test = Clock.tick(Clock.system(PARIS), Duration.ofMillis(500)); in test_withZone_same() 87 Clock changed = test.withZone(PARIS); in test_withZone_same() 93 Clock test = Clock.tick(Clock.systemUTC(), Duration.ofMillis(500)); in test_toString()
|
D | TestClock_Fixed.java | 65 import java.time.Clock; 84 Clock test = Clock.fixed(INSTANT, PARIS); in test_withZone_same() 85 Clock changed = test.withZone(PARIS); in test_withZone_same() 91 Clock test = Clock.fixed(INSTANT, PARIS); in test_toString()
|
D | TestInstantSource.java | 30 import java.time.Clock; 50 assertSame(test.withZone(ZoneOffset.UTC), Clock.systemUTC()); in test_system() 51 assertEquals(test.withZone(PARIS), Clock.system(PARIS)); in test_system() 67 …assertEquals(test.withZone(ZoneOffset.UTC), Clock.tick(Clock.fixed(instant, ZoneOffset.UTC), durat… 68 assertEquals(test.withZone(PARIS), Clock.tick(Clock.fixed(instant, PARIS), duration)); 79 assertEquals(test.withZone(ZoneOffset.UTC), Clock.fixed(instant, ZoneOffset.UTC)); 80 assertEquals(test.withZone(PARIS), Clock.fixed(instant, PARIS)); 92 …assertEquals(test.withZone(ZoneOffset.UTC), Clock.offset(Clock.fixed(instant, ZoneOffset.UTC), dur… 93 assertEquals(test.withZone(PARIS), Clock.offset(Clock.fixed(instant, PARIS), duration));
|
D | TestClock_System.java | 69 import java.time.Clock; 84 private static final Clock systemUTC = Clock.systemUTC(); 87 Clock test = Clock.system(PARIS); in test_withZone_same() 88 Clock changed = test.withZone(PARIS); in test_withZone_same() 94 Clock test = Clock.system(PARIS); in test_toString() 102 {"Clock.systemUTC()#1", Clock.systemUTC()}, in provider_sampleSystemUTC() 103 {"Clock.systemUTC()#2", Clock.systemUTC()}, in provider_sampleSystemUTC() 104 {"Clock.system(ZoneOffset.UTC)#1", Clock.system(ZoneOffset.UTC)}, in provider_sampleSystemUTC() 105 {"Clock.system(ZoneOffset.UTC)#2", Clock.system(ZoneOffset.UTC)} in provider_sampleSystemUTC() 111 public void test_systemUTC(String s, Clock clock) { in test_systemUTC() [all …]
|
D | TestLocalTime.java | 66 import java.time.Clock; 192 LocalTime.now(Clock.systemDefaultZone()); in now() 196 LocalTime expected = LocalTime.now(Clock.systemDefaultZone()); in now()
|
/libcore/ojluni/src/main/java/java/time/chrono/ |
D | MinguoChronology.java | 65 import java.time.Clock; 239 return dateNow(Clock.systemDefaultZone()); in dateNow() 244 return dateNow(Clock.system(zone)); in dateNow() 248 public MinguoDate dateNow(Clock clock) { in dateNow()
|
D | ThaiBuddhistChronology.java | 65 import java.time.Clock; 275 return dateNow(Clock.systemDefaultZone()); in dateNow() 280 return dateNow(Clock.system(zone)); in dateNow() 284 public ThaiBuddhistDate dateNow(Clock clock) { in dateNow()
|
D | Chronology.java | 68 import java.time.Clock; 391 return dateNow(Clock.systemDefaultZone()); in dateNow() 411 return dateNow(Clock.system(zone)); in dateNow() 428 default ChronoLocalDate dateNow(Clock clock) { in dateNow()
|
D | MinguoDate.java | 70 import java.time.Clock; 128 return now(Clock.systemDefaultZone()); in now() 144 return now(Clock.system(zone)); in now() 158 public static MinguoDate now(Clock clock) { in now()
|
D | ThaiBuddhistDate.java | 70 import java.time.Clock; 128 return now(Clock.systemDefaultZone()); in now() 144 return now(Clock.system(zone)); in now() 158 public static ThaiBuddhistDate now(Clock clock) { in now()
|
D | IsoChronology.java | 77 import java.time.Clock; 418 return dateNow(Clock.systemDefaultZone()); in dateNow() 435 return dateNow(Clock.system(zone)); in dateNow() 450 public LocalDate dateNow(Clock clock) { in dateNow()
|
D | JapaneseChronology.java | 71 import java.time.Clock; 295 return dateNow(Clock.systemDefaultZone()); in dateNow() 300 return dateNow(Clock.system(zone)); in dateNow() 304 public JapaneseDate dateNow(Clock clock) { in dateNow()
|
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/ |
D | TCKChronology.java | 76 import java.time.Clock; 243 Clock clock = Clock.system(zoneId_paris); in test_MinguoChronology_dateNow() 254 Clock clock = Clock.system(zoneId_paris); in test_IsoChronology_dateNow() 265 Clock clock = Clock.system(zoneId_paris); in test_JapaneseChronology_dateNow() 276 Clock clock = Clock.system(zoneId_paris); in test_ThaiBuddhistChronology_dateNow()
|
D | TCKHijrahChronology.java | 59 import java.time.Clock; 110 … assertEquals(HijrahChronology.INSTANCE.dateNow(), HijrahDate.now(Clock.systemDefaultZone())) ; in test_dateNow() 111 …assertEquals(HijrahChronology.INSTANCE.dateNow(), HijrahDate.now(Clock.systemDefaultZone().getZone… in test_dateNow() 114 …assertEquals(HijrahChronology.INSTANCE.dateNow(), HijrahChronology.INSTANCE.dateNow(Clock.systemDe… in test_dateNow() 115 …assertEquals(HijrahChronology.INSTANCE.dateNow(), HijrahChronology.INSTANCE.dateNow(Clock.systemDe… in test_dateNow() 118 …jrahChronology.INSTANCE.dateNow(zoneId), HijrahChronology.INSTANCE.dateNow(Clock.system(zoneId))) ; in test_dateNow() 119 …rahChronology.INSTANCE.dateNow(zoneId), HijrahChronology.INSTANCE.dateNow(Clock.system(zoneId).get… in test_dateNow() 120 … assertEquals(HijrahChronology.INSTANCE.dateNow(zoneId), HijrahDate.now(Clock.system(zoneId))) ; in test_dateNow() 121 …assertEquals(HijrahChronology.INSTANCE.dateNow(zoneId), HijrahDate.now(Clock.system(zoneId).getZon… in test_dateNow() 123 …dateNow(ZoneId.of(ZoneOffset.UTC.getId())), HijrahChronology.INSTANCE.dateNow(Clock.systemUTC())) ; in test_dateNow()
|