Home
last modified time | relevance | path

Searched refs:MILLISECONDS (Results 1 – 25 of 95) sorted by relevance

1234

/libcore/ojluni/src/test/java/nio/file/attribute/
DFileTimeTest.java50 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/ojluni/src/test/java/util/concurrent/tck/
DThreadPoolExecutorTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
78 super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>()); in ExtendedTPE()
115 LONG_DELAY_MS, MILLISECONDS, in testExecute()
122 assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); in testExecute()
134 LONG_DELAY_MS, MILLISECONDS, in testGetActiveCount()
156 LONG_DELAY_MS, MILLISECONDS, in testPrestartCoreThread()
182 LONG_DELAY_MS, MILLISECONDS, in testPrestartAllCoreThreads()
205 LONG_DELAY_MS, MILLISECONDS, in testGetCompletedTaskCount()
238 LONG_DELAY_MS, MILLISECONDS, in testGetCorePoolSize()
251 1000, MILLISECONDS, in testGetKeepAliveTime()
[all …]
DThreadPoolExecutorSubclassTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
225 super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>()); in CustomTPE()
262 2 * LONG_DELAY_MS, MILLISECONDS, in testExecute()
269 assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); in testExecute()
281 LONG_DELAY_MS, MILLISECONDS, in testGetActiveCount()
303 LONG_DELAY_MS, MILLISECONDS, in testPrestartCoreThread()
329 LONG_DELAY_MS, MILLISECONDS, in testPrestartAllCoreThreads()
352 LONG_DELAY_MS, MILLISECONDS, in testGetCompletedTaskCount()
385 LONG_DELAY_MS, MILLISECONDS, in testGetCorePoolSize()
398 1000, MILLISECONDS, in testGetKeepAliveTime()
[all …]
DTimeUnitTest.java40 import static java.util.concurrent.TimeUnit.MILLISECONDS;
76 SECONDS.convert(1000L*t, MILLISECONDS)); in testConvert()
83 MILLISECONDS.convert(t, DAYS)); in testConvert()
85 MILLISECONDS.convert(t, HOURS)); in testConvert()
87 MILLISECONDS.convert(t, MINUTES)); in testConvert()
89 MILLISECONDS.convert(t, SECONDS)); in testConvert()
91 MILLISECONDS.convert(t, MILLISECONDS)); in testConvert()
93 MILLISECONDS.convert(1000L*t, MICROSECONDS)); in testConvert()
95 MILLISECONDS.convert(1000000L*t, NANOSECONDS)); in testConvert()
106 MICROSECONDS.convert(t, MILLISECONDS)); in testConvert()
[all …]
DScheduledExecutorTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
81 assertTrue(done.await(LONG_DELAY_MS, MILLISECONDS)); in testExecute()
99 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
102 assertTrue(done.await(0L, MILLISECONDS)); in testSchedule1()
119 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
121 assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); in testSchedule3()
141 LONG_DELAY_MS, MILLISECONDS); in testSchedule4()
163 LONG_DELAY_MS, MILLISECONDS); in testSchedule5()
190 p.scheduleAtFixedRate(task, 0, delay, MILLISECONDS); in testFixedRateSequence()
236 p.scheduleWithFixedDelay(task, 0, delay, MILLISECONDS); in testFixedDelaySequence()
[all …]
DExchangerTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
82 assertSame(one, e.exchange(two, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
83 assertSame(two, e.exchange(one, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
87 assertSame(two, e.exchange(one, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
88 assertSame(one, e.exchange(two, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
121 e.exchange(null, LONG_DELAY_MS, MILLISECONDS); in testTimedExchange_InterruptedException()
138 e.exchange(null, timeoutMillis(), MILLISECONDS); in testExchange_TimeoutException()
DScheduledExecutorSubclassTest.java35 import static java.util.concurrent.TimeUnit.MILLISECONDS;
156 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
175 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
177 assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); in testSchedule3()
197 LONG_DELAY_MS, MILLISECONDS); in testSchedule4()
219 LONG_DELAY_MS, MILLISECONDS); in testSchedule5()
246 p.scheduleAtFixedRate(task, 0, delay, MILLISECONDS); in testFixedRateSequence()
292 p.scheduleWithFixedDelay(task, 0, delay, MILLISECONDS); in testFixedDelaySequence()
327 Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testScheduleNull()
342 MEDIUM_DELAY_MS, MILLISECONDS); in testSchedule1_RejectedExecutionException()
[all …]
DBlockingQueueTest.java38 import static java.util.concurrent.TimeUnit.MILLISECONDS;
119 q.offer(null, LONG_DELAY_MS, MILLISECONDS); in testTimedOfferNull()
246 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer()
251 assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer()
255 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
262 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
272 assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer()
332 q.poll(2 * LONG_DELAY_MS, MILLISECONDS);
354 q.poll(2 * LONG_DELAY_MS, MILLISECONDS);
DLinkedBlockingDequeTest.java35 import static java.util.concurrent.TimeUnit.MILLISECONDS;
687 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
691 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer()
762 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0()
764 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
774 assertEquals(i, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll()
778 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
794 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll()
798 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
917 assertFalse(q.offerFirst(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOfferFirst()
[all …]
DAbstractExecutorServiceTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
98 assertNull(future.get(0, MILLISECONDS)); in testExecuteRunnable()
225 assertTrue(quittingTime.await(2*LONG_DELAY_MS, MILLISECONDS)); in testInterruptedSubmit()
422 e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny1()
451 MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny2()
468 e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny3()
484 e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS); in testTimedInvokeAny4()
503 String result = e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS);
516 e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
543 …<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
[all …]
DCountDownLatchTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
120 assertTrue(l.await(LONG_DELAY_MS, MILLISECONDS)); in testTimedAwait()
175 l.await(LONG_DELAY_MS, MILLISECONDS); in testTimedAwait_Interruptible()
182 l.await(LONG_DELAY_MS, MILLISECONDS); in testTimedAwait_Interruptible()
204 assertFalse(l.await(timeoutMillis(), MILLISECONDS)); in testAwaitTimeout()
DSynchronousQueueTest.java37 import static java.util.concurrent.TimeUnit.MILLISECONDS;
220 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
224 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer()
252 try { assertNull(q.poll(0, MILLISECONDS)); } in testTimedPoll0()
264 try { assertNull(q.poll(timeoutMillis(), MILLISECONDS)); } in testTimedPoll() local
282 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer()
287 assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer()
291 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
298 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
308 try { assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); } in testTimedPollWithOffer()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadPoolExecutorTest.java11 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 …]
DTimeUnitTest.java14 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 …]
DThreadPoolExecutorSubclassTest.java11 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 …]
DScheduledExecutorTest.java11 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 …]
DExchangerTest.java11 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()
DScheduledExecutorSubclassTest.java9 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 …]
DBlockingQueueTest.java12 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);
DLinkedBlockingDequeTest.java9 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 …]
DAbstractExecutorServiceTest.java11 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 …]
DCountDownLatchTest.java11 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()
DSynchronousQueueTest.java11 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 …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DAsynchronousSocketChannelTest.java67 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/util/concurrent/
DExecutorServiceAutoCloseable.java36 if(!service.awaitTermination(5000, TimeUnit.MILLISECONDS)) { in close()
38 service.awaitTermination(1000, TimeUnit.MILLISECONDS); in close()

1234