36 |
|
} |
37 |
|
|
38 |
|
/** |
39 |
< |
* execute of runnable runs it to completion |
39 |
> |
* execute(runnable) runs it to completion |
40 |
|
*/ |
41 |
|
public void testExecuteRunnable() { |
42 |
|
try { |
57 |
|
|
58 |
|
|
59 |
|
/** |
60 |
< |
* completed submit of callable returns result |
60 |
> |
* Completed submit(callable) returns result |
61 |
|
*/ |
62 |
|
public void testSubmitCallable() { |
63 |
|
try { |
75 |
|
} |
76 |
|
|
77 |
|
/** |
78 |
< |
* completed submit of runnable returns successfully |
78 |
> |
* Completed submit(runnable) returns successfully |
79 |
|
*/ |
80 |
|
public void testSubmitRunnable() { |
81 |
|
try { |
93 |
|
} |
94 |
|
|
95 |
|
/** |
96 |
< |
* completed submit of (runnable, result) returns result |
96 |
> |
* Completed submit(runnable, result) returns result |
97 |
|
*/ |
98 |
|
public void testSubmitRunnable2() { |
99 |
|
try { |
112 |
|
|
113 |
|
|
114 |
|
/** |
115 |
< |
* submit of a privileged action runs it to completion |
115 |
> |
* A submitted privileged action to completion |
116 |
|
*/ |
117 |
|
public void testSubmitPrivilegedAction() { |
118 |
|
Policy savedPolicy = Policy.getPolicy(); |
142 |
|
} |
143 |
|
|
144 |
|
/** |
145 |
< |
* submit of a privileged exception action runs it to completion |
145 |
> |
* A submitted a privileged exception action runs to completion |
146 |
|
*/ |
147 |
|
public void testSubmitPrivilegedExceptionAction() { |
148 |
|
Policy savedPolicy = Policy.getPolicy(); |
172 |
|
} |
173 |
|
|
174 |
|
/** |
175 |
< |
* submit of a failed privileged exception action reports exception |
175 |
> |
* A submitted failed privileged exception action reports exception |
176 |
|
*/ |
177 |
|
public void testSubmitFailedPrivilegedExceptionAction() { |
178 |
|
Policy savedPolicy = Policy.getPolicy(); |
201 |
|
} |
202 |
|
|
203 |
|
/** |
204 |
< |
* execute with a null runnable throws NPE |
204 |
> |
* execute(null runnable) throws NPE |
205 |
|
*/ |
206 |
|
public void testExecuteNullRunnable() { |
207 |
|
try { |
219 |
|
|
220 |
|
|
221 |
|
/** |
222 |
< |
* submit of a null callable throws NPE |
222 |
> |
* submit(null callable) throws NPE |
223 |
|
*/ |
224 |
|
public void testSubmitNullCallable() { |
225 |
|
try { |
236 |
|
} |
237 |
|
|
238 |
|
/** |
239 |
< |
* submit of Runnable throws RejectedExecutionException if |
240 |
< |
* saturated. |
239 |
> |
* submit(runnable) throws RejectedExecutionException if |
240 |
> |
* executor is saturated. |
241 |
|
*/ |
242 |
|
public void testExecute1() { |
243 |
|
ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, SHORT_DELAY_MS, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(1)); |
252 |
|
} |
253 |
|
|
254 |
|
/** |
255 |
< |
* Completed submit of Callable throws RejectedExecutionException |
256 |
< |
* if saturated. |
255 |
> |
* submit(callable) throws RejectedExecutionException |
256 |
> |
* if executor is saturated. |
257 |
|
*/ |
258 |
|
public void testExecute2() { |
259 |
|
ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, SHORT_DELAY_MS, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(1)); |
268 |
|
|
269 |
|
|
270 |
|
/** |
271 |
< |
* blocking on submit of Callable throws InterruptedException if |
271 |
> |
* Blocking on submit(callable) throws InterruptedException if |
272 |
|
* caller interrupted. |
273 |
|
*/ |
274 |
|
public void testInterruptedSubmit() { |
304 |
|
} |
305 |
|
|
306 |
|
/** |
307 |
< |
* get of submit of Callable throws Exception if callable |
307 |
> |
* get of submitted callable throws Exception if callable |
308 |
|
* interrupted |
309 |
|
*/ |
310 |
|
public void testSubmitIE() { |
344 |
|
} |
345 |
|
|
346 |
|
/** |
347 |
< |
* completed submit of Callable throws ExecutionException if |
348 |
< |
* callable throws exception |
347 |
> |
* get of submit(callable) throws ExecutionException if callable |
348 |
> |
* throws exception |
349 |
|
*/ |
350 |
|
public void testSubmitEE() { |
351 |
|
ThreadPoolExecutor p = new ThreadPoolExecutor(1,1,SHORT_DELAY_MS, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(10)); |
421 |
|
} |
422 |
|
|
423 |
|
/** |
424 |
< |
* invokeAny(c) throws ExecutionException if no task completes |
424 |
> |
* invokeAny(c) throws ExecutionException if no task in c completes |
425 |
|
*/ |
426 |
|
public void testInvokeAny4() { |
427 |
|
ExecutorService e = new DirectExecutorService(); |
438 |
|
} |
439 |
|
|
440 |
|
/** |
441 |
< |
* invokeAny(c) returns result of some task |
441 |
> |
* invokeAny(c) returns result of some task in c if at least one completes |
442 |
|
*/ |
443 |
|
public void testInvokeAny5() { |
444 |
|
ExecutorService e = new DirectExecutorService(); |
505 |
|
} |
506 |
|
|
507 |
|
/** |
508 |
< |
* get of element of invokeAll(c) throws exception on failed task |
508 |
> |
* get of returned element of invokeAll(c) throws exception on failed task |
509 |
|
*/ |
510 |
|
public void testInvokeAll4() { |
511 |
|
ExecutorService e = new DirectExecutorService(); |
525 |
|
} |
526 |
|
|
527 |
|
/** |
528 |
< |
* invokeAll(c) returns results of all completed tasks |
528 |
> |
* invokeAll(c) returns results of all completed tasks in c |
529 |
|
*/ |
530 |
|
public void testInvokeAll5() { |
531 |
|
ExecutorService e = new DirectExecutorService(); |
562 |
|
} |
563 |
|
|
564 |
|
/** |
565 |
< |
* timed invokeAny(,,null) throws NPE |
565 |
> |
* timed invokeAny(null time unit) throws NPE |
566 |
|
*/ |
567 |
|
public void testTimedInvokeAnyNullTimeUnit() { |
568 |
|
ExecutorService e = new DirectExecutorService(); |
630 |
|
} |
631 |
|
|
632 |
|
/** |
633 |
< |
* timed invokeAny(c) returns result of some task |
633 |
> |
* timed invokeAny(c) returns result of some task in c |
634 |
|
*/ |
635 |
|
public void testTimedInvokeAny5() { |
636 |
|
ExecutorService e = new DirectExecutorService(); |
664 |
|
} |
665 |
|
|
666 |
|
/** |
667 |
< |
* timed invokeAll(,,null) throws NPE |
667 |
> |
* timed invokeAll(null time unit) throws NPE |
668 |
|
*/ |
669 |
|
public void testTimedInvokeAllNullTimeUnit() { |
670 |
|
ExecutorService e = new DirectExecutorService(); |
714 |
|
} |
715 |
|
|
716 |
|
/** |
717 |
< |
* get of element of invokeAll(c) throws exception on failed task |
717 |
> |
* get of returned element of invokeAll(c) throws exception on failed task |
718 |
|
*/ |
719 |
|
public void testTimedInvokeAll4() { |
720 |
|
ExecutorService e = new DirectExecutorService(); |
734 |
|
} |
735 |
|
|
736 |
|
/** |
737 |
< |
* timed invokeAll(c) returns results of all completed tasks |
737 |
> |
* timed invokeAll(c) returns results of all completed tasks in c |
738 |
|
*/ |
739 |
|
public void testTimedInvokeAll5() { |
740 |
|
ExecutorService e = new DirectExecutorService(); |
755 |
|
} |
756 |
|
|
757 |
|
/** |
758 |
< |
* timed invokeAll(c) cancels tasks not completed by timeout |
758 |
> |
* timed invokeAll cancels tasks not completed by timeout |
759 |
|
*/ |
760 |
|
public void testTimedInvokeAll6() { |
761 |
|
ExecutorService e = new DirectExecutorService(); |