/libcore/ojluni/src/test/java/nio/file/attribute/ |
D | FileTimeTest.java | 50 long tomorrowInDays = TimeUnit.DAYS.convert(now, MILLISECONDS) + 1; in main() 51 long yesterdayInDays = TimeUnit.DAYS.convert(now, MILLISECONDS) - 1; in main() 56 eq(now, MILLISECONDS, now, MILLISECONDS); in main() 57 eq(now, MILLISECONDS, now*1000L, MICROSECONDS); in main() 58 neq(now, MILLISECONDS, 0, MILLISECONDS); in main() 59 neq(now, MILLISECONDS, 0, MICROSECONDS); in main() 61 eq(nowInstant, now, MILLISECONDS); in main() 63 neq(nowInstant, 0, MILLISECONDS); in main() 67 cmp(now, MILLISECONDS, now, MILLISECONDS, 0); in main() 68 cmp(now, MILLISECONDS, now*1000L, MICROSECONDS, 0); in main() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | ThreadPoolExecutorTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 56 super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>()); in ExtendedTPE() 93 LONG_DELAY_MS, MILLISECONDS, in testExecute() 100 assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); in testExecute() 112 LONG_DELAY_MS, MILLISECONDS, in testGetActiveCount() 134 LONG_DELAY_MS, MILLISECONDS, in testPrestartCoreThread() 160 LONG_DELAY_MS, MILLISECONDS, in testPrestartAllCoreThreads() 183 LONG_DELAY_MS, MILLISECONDS, in testGetCompletedTaskCount() 216 LONG_DELAY_MS, MILLISECONDS, in testGetCorePoolSize() 229 1000, MILLISECONDS, in testGetKeepAliveTime() [all …]
|
D | TimeUnitTest.java | 14 import static java.util.concurrent.TimeUnit.MILLISECONDS; 52 SECONDS.convert(1000L*t, MILLISECONDS)); in testConvert() 59 MILLISECONDS.convert(t, DAYS)); in testConvert() 61 MILLISECONDS.convert(t, HOURS)); in testConvert() 63 MILLISECONDS.convert(t, MINUTES)); in testConvert() 65 MILLISECONDS.convert(t, SECONDS)); in testConvert() 67 MILLISECONDS.convert(t, MILLISECONDS)); in testConvert() 69 MILLISECONDS.convert(1000L*t, MICROSECONDS)); in testConvert() 71 MILLISECONDS.convert(1000000L*t, NANOSECONDS)); in testConvert() 82 MICROSECONDS.convert(t, MILLISECONDS)); in testConvert() [all …]
|
D | ThreadPoolExecutorSubclassTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 203 super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>()); in CustomTPE() 240 2 * LONG_DELAY_MS, MILLISECONDS, in testExecute() 247 assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); in testExecute() 259 LONG_DELAY_MS, MILLISECONDS, in testGetActiveCount() 281 LONG_DELAY_MS, MILLISECONDS, in testPrestartCoreThread() 307 LONG_DELAY_MS, MILLISECONDS, in testPrestartAllCoreThreads() 330 LONG_DELAY_MS, MILLISECONDS, in testGetCompletedTaskCount() 363 LONG_DELAY_MS, MILLISECONDS, in testGetCorePoolSize() 376 1000, MILLISECONDS, in testGetKeepAliveTime() [all …]
|
D | ExchangerTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 59 assertSame(one, e.exchange(two, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange() 60 assertSame(two, e.exchange(one, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange() 64 assertSame(two, e.exchange(one, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange() 65 assertSame(one, e.exchange(two, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange() 98 e.exchange(null, LONG_DELAY_MS, MILLISECONDS); in testTimedExchange_InterruptedException() 115 e.exchange(null, timeoutMillis(), MILLISECONDS); in testExchange_TimeoutException()
|
D | ScheduledExecutorTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 59 assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); in testExecute() 77 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1() 80 assertTrue(done.await(0L, MILLISECONDS)); in testSchedule1() 97 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3() 99 assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); in testSchedule3() 119 LONG_DELAY_MS, MILLISECONDS); in testSchedule4() 141 LONG_DELAY_MS, MILLISECONDS); in testSchedule5() 168 p.scheduleAtFixedRate(task, 0, delay, MILLISECONDS); in testFixedRateSequence() 214 p.scheduleWithFixedDelay(task, 0, delay, MILLISECONDS); in testFixedDelaySequence() [all …]
|
D | ScheduledExecutorSubclassTest.java | 9 import static java.util.concurrent.TimeUnit.MILLISECONDS; 134 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1() 153 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3() 155 assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); in testSchedule3() 175 LONG_DELAY_MS, MILLISECONDS); in testSchedule4() 197 LONG_DELAY_MS, MILLISECONDS); in testSchedule5() 224 p.scheduleAtFixedRate(task, 0, delay, MILLISECONDS); in testFixedRateSequence() 270 p.scheduleWithFixedDelay(task, 0, delay, MILLISECONDS); in testFixedDelaySequence() 305 Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testScheduleNull() 320 MEDIUM_DELAY_MS, MILLISECONDS); in testSchedule1_RejectedExecutionException() [all …]
|
D | BlockingQueueTest.java | 12 import static java.util.concurrent.TimeUnit.MILLISECONDS; 95 q.offer(null, LONG_DELAY_MS, MILLISECONDS); in testTimedOfferNull() 222 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer() 227 assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer() 231 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer() 238 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer() 248 assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer() 308 q.poll(2 * LONG_DELAY_MS, MILLISECONDS); 330 q.poll(2 * LONG_DELAY_MS, MILLISECONDS);
|
D | LinkedBlockingDequeTest.java | 9 import static java.util.concurrent.TimeUnit.MILLISECONDS; 653 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer() 657 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer() 728 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0() 730 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0() 740 assertEquals(i, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll() 744 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll() 760 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll() 764 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll() 883 assertFalse(q.offerFirst(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOfferFirst() [all …]
|
D | CountDownLatchTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 97 assertTrue(l.await(LONG_DELAY_MS, MILLISECONDS)); in testTimedAwait() 152 l.await(LONG_DELAY_MS, MILLISECONDS); in testTimedAwait_Interruptible() 159 l.await(LONG_DELAY_MS, MILLISECONDS); in testTimedAwait_Interruptible() 181 assertFalse(l.await(timeoutMillis(), MILLISECONDS)); in testAwaitTimeout()
|
D | AbstractExecutorServiceTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 75 assertNull(future.get(0, MILLISECONDS)); in testExecuteRunnable() 202 assertTrue(quittingTime.await(2*LONG_DELAY_MS, MILLISECONDS)); in testInterruptedSubmit() 399 e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny1() 428 MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny2() 445 e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny3() 461 e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS); in testTimedInvokeAny4() 480 String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS); 493 e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS); 520 …<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS); [all …]
|
D | SynchronousQueueTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 199 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer() 203 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer() 231 try { assertNull(q.poll(0, MILLISECONDS)); } in testTimedPoll0() 243 try { assertNull(q.poll(timeoutMillis(), MILLISECONDS)); } in testTimedPoll() local 261 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer() 266 assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer() 270 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer() 277 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer() 287 try { assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); } in testTimedPollWithOffer() [all …]
|
D | CyclicBarrierTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 161 c.await(LONG_DELAY_MS, MILLISECONDS); in testAwait2_Interrupted_BrokenBarrier() 166 c.await(LONG_DELAY_MS, MILLISECONDS); in testAwait2_Interrupted_BrokenBarrier() 186 c.await(timeoutMillis(), MILLISECONDS); in testAwait3_TimeoutException() 204 c.await(LONG_DELAY_MS, MILLISECONDS); in testAwait4_Timeout_BrokenBarrier() 213 c.await(timeoutMillis(), MILLISECONDS); in testAwait4_Timeout_BrokenBarrier() 241 c.await(timeoutMillis(), MILLISECONDS); in testAwait5_Timeout_BrokenBarrier() 413 barrier.await(timeoutMillis(), MILLISECONDS); in testResetAfterTimeout()
|
D | ForkJoinPoolTest.java | 9 import static java.util.concurrent.TimeUnit.MILLISECONDS; 250 assertFalse(p.awaitTermination(Long.MIN_VALUE, MILLISECONDS)); in testAwaitTermination_timesOut() 252 assertFalse(p.awaitTermination(-1L, MILLISECONDS)); in testAwaitTermination_timesOut() 254 assertFalse(p.awaitTermination(0L, MILLISECONDS)); in testAwaitTermination_timesOut() 262 assertFalse(p.awaitTermination(timeoutMillis, MILLISECONDS)); in testAwaitTermination_timesOut() 266 assertTrue(p.awaitTermination(LONG_DELAY_MS, MILLISECONDS)); in testAwaitTermination_timesOut() 435 assertNull(future.get(0, MILLISECONDS)); in testExecuteRunnable() 576 assertTrue(quittingTime.await(2*LONG_DELAY_MS, MILLISECONDS)); in testInterruptedSubmit() 786 e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny1() 815 MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny2() [all …]
|
D | StampedLockTest.java | 10 import static java.util.concurrent.TimeUnit.MILLISECONDS; 255 assertTrue((s = lock.tryWriteLock(100L, MILLISECONDS)) != 0L); in testValidate() 258 assertTrue((s = lock.tryReadLock(100L, MILLISECONDS)) != 0L); in testValidate() 273 assertFalse(lock.validate(lock.tryWriteLock(10L, MILLISECONDS))); in testValidate2() 275 assertFalse(lock.validate(lock.tryReadLock(10L, MILLISECONDS))); in testValidate2() 311 lock.tryWriteLock(2 * LONG_DELAY_MS, MILLISECONDS); in testWriteTryLock_Interruptible() 352 lock.tryReadLock(2 * LONG_DELAY_MS, MILLISECONDS); in testReadTryLock_Interruptible() 418 long s3 = lock.tryReadLock(LONG_DELAY_MS, MILLISECONDS); in testMultipleReadLocks() 542 long ws = lock.tryWriteLock(timeoutMillis, MILLISECONDS); in testWriteTryLock_Timeout() 561 long rs = lock.tryReadLock(timeoutMillis, MILLISECONDS); in testReadTryLock_Timeout() [all …]
|
D | LinkedTransferQueueTest.java | 10 import static java.util.concurrent.TimeUnit.MILLISECONDS; 265 assertEquals(i, (int) q.poll(0, MILLISECONDS)); in testTimedPoll0() 267 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0() 278 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll() 282 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll() 298 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll() 301 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll() 325 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollAfterInterrupt() 327 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollAfterInterrupt() 611 assertTrue(q.offer(one, LONG_DELAY_MS, MILLISECONDS)); in testOfferInExecutor() [all …]
|
D | Collection8Test.java | 10 import static java.util.concurrent.TimeUnit.MILLISECONDS; 99 assertNull(f1.get(0L, MILLISECONDS)); in testForEachConcurrentStressTest() 100 assertNull(f2.get(0L, MILLISECONDS)); in testForEachConcurrentStressTest()
|
D | DelayQueueTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 336 assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS)); in testTimedOffer() 337 assertTrue(q.offer(new PDelay(0), LONG_DELAY_MS, MILLISECONDS)); in testTimedOffer() 403 assertEquals(new PDelay(i), q.poll(0, MILLISECONDS)); in testTimedPoll0() 405 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0() 415 assertEquals(new PDelay(i), q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll() 419 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll() 436 ((PDelay)q.poll(LONG_DELAY_MS, MILLISECONDS))); in testInterruptedTimedPoll() 441 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll() 448 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll() [all …]
|
D | PriorityBlockingQueueTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 306 assertTrue(q.offer(new Integer(0), SHORT_DELAY_MS, MILLISECONDS)); in testTimedOffer() 307 assertTrue(q.offer(new Integer(0), LONG_DELAY_MS, MILLISECONDS)); in testTimedOffer() 373 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0() 375 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0() 385 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll() 389 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll() 405 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll() 409 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll() 638 assertSame(one, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testPollInExecutor()
|
D | ExecutorsTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 212 timeoutMillis(), MILLISECONDS); in testNewSingleThreadScheduledExecutor() 215 assertSame(Boolean.TRUE, f.get(LONG_DELAY_MS, MILLISECONDS)); in testNewSingleThreadScheduledExecutor() 236 timeoutMillis(), MILLISECONDS); in testNewScheduledThreadPool() 239 assertSame(Boolean.TRUE, f.get(LONG_DELAY_MS, MILLISECONDS)); in testNewScheduledThreadPool() 262 timeoutMillis(), MILLISECONDS); in testUnconfigurableScheduledExecutorService() 265 assertSame(Boolean.TRUE, f.get(LONG_DELAY_MS, MILLISECONDS)); in testUnconfigurableScheduledExecutorService()
|
D | LinkedBlockingQueueTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 345 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer() 349 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer() 420 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0() 422 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0() 432 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll() 436 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll() 452 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll() 456 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll() 737 assertTrue(q.offer(three, LONG_DELAY_MS, MILLISECONDS)); in testOfferInExecutor() [all …]
|
D | FutureTaskTest.java | 11 import static java.util.concurrent.TimeUnit.MILLISECONDS; 309 assertSame(one, task.get(LONG_DELAY_MS, MILLISECONDS)); in testSet() 334 task.get(LONG_DELAY_MS, MILLISECONDS); in testSetException_get() 564 assertSame(two, task.get(2*LONG_DELAY_MS, MILLISECONDS)); in testGetRun() 603 assertSame(two, task.get(2*LONG_DELAY_MS, MILLISECONDS)); in testGetSet() 656 task.get(2*LONG_DELAY_MS, MILLISECONDS); in testTimedGet_Cancellation() 712 task.get(LONG_DELAY_MS, MILLISECONDS); in testTimedGet_ExecutionException2() 760 task.get(2*LONG_DELAY_MS, MILLISECONDS); in testTimedGet_interruptible() 767 task.get(2*LONG_DELAY_MS, MILLISECONDS); in testTimedGet_interruptible() 786 task.get(timeoutMillis(), MILLISECONDS); in testGet_TimeoutException() local
|
/libcore/luni/src/test/java/libcore/java/nio/channels/ |
D | AsynchronousSocketChannelTest.java | 67 connectFuture.get(1000, TimeUnit.MILLISECONDS); in test_connect() 195 readFuture.get(1000, TimeUnit.MILLISECONDS); in test_close() 202 … asc.read(new ByteBuffer[]{tmp}, 0, 1, 100L, TimeUnit.MILLISECONDS, null, longCompletionHandler); in test_close() 218 asc.read(tmp, 100, TimeUnit.MILLISECONDS, null, intCompletionHandler); in test_close() 226 writeFuture.get(1000, TimeUnit.MILLISECONDS); in test_close() 233 … asc.write(new ByteBuffer[]{tmp}, 0, 1, 100, TimeUnit.MILLISECONDS, null, longCompletionHandler); in test_close() 247 asc.write(tmp, 100, TimeUnit.MILLISECONDS, null, intCompletionHandler); in test_close() 276 connectFuture.get(1000, TimeUnit.MILLISECONDS); in test_futureReadWrite() 289 assertEquals(messageSize, (int)asc.read(receivedData).get(1000, TimeUnit.MILLISECONDS)); in test_futureReadWrite() 296 assertEquals(messageSize, (int)asc.write(sendData).get(1000, TimeUnit.MILLISECONDS)); in test_futureReadWrite() [all …]
|
/libcore/luni/src/test/java/libcore/java/net/ |
D | SocketTimeoutTest.java | 137 assertTrue(threadStarted.await(500, TimeUnit.MILLISECONDS)); in testSocketWriteNeverTimeouts() 142 !writeCompleted.await(TIMEOUT_MILLIS * 2, TimeUnit.MILLISECONDS); in testSocketWriteNeverTimeouts() 147 assertTrue(writeCompleted.await(5000, TimeUnit.MILLISECONDS)); in testSocketWriteNeverTimeouts()
|
/libcore/ojluni/src/main/java/java/time/zone/ |
D | IcuZoneRulesProvider.java | 140 TimeUnit.MILLISECONDS.toSeconds(transition.getTime()), in generateZoneRules() 149 TimeUnit.MILLISECONDS.toSeconds(transition.getTime()), in generateZoneRules() 256 int secondOfDay = (int) TimeUnit.MILLISECONDS.toSeconds(dateTimeRule.getRuleMillisInDay()); in toZoneOffsetTransitionRule() 292 return ZoneOffset.ofTotalSeconds((int) TimeUnit.MILLISECONDS.toSeconds(offset)); in millisToOffset()
|