ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ThreadPoolExecutorSubclassTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ThreadPoolExecutorSubclassTest.java (file contents):
Revision 1.18 by jsr166, Wed Aug 25 00:07:03 2010 UTC vs.
Revision 1.19 by jsr166, Sat Oct 9 19:30:35 2010 UTC

# Line 192 | Line 192 | public class ThreadPoolExecutorSubclassT
192  
193  
194      /**
195 <     *  execute successfully executes a runnable
195 >     * execute successfully executes a runnable
196       */
197      public void testExecute() throws InterruptedException {
198          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 205 | Line 205 | public class ThreadPoolExecutorSubclassT
205      }
206  
207      /**
208 <     *  getActiveCount increases but doesn't overestimate, when a
209 <     *  thread becomes active
208 >     * getActiveCount increases but doesn't overestimate, when a
209 >     * thread becomes active
210       */
211      public void testGetActiveCount() throws InterruptedException {
212          ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 218 | Line 218 | public class ThreadPoolExecutorSubclassT
218      }
219  
220      /**
221 <     *  prestartCoreThread starts a thread if under corePoolSize, else doesn't
221 >     * prestartCoreThread starts a thread if under corePoolSize, else doesn't
222       */
223      public void testPrestartCoreThread() {
224          ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 233 | Line 233 | public class ThreadPoolExecutorSubclassT
233      }
234  
235      /**
236 <     *  prestartAllCoreThreads starts all corePoolSize threads
236 >     * prestartAllCoreThreads starts all corePoolSize threads
237       */
238      public void testPrestartAllCoreThreads() {
239          ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 246 | Line 246 | public class ThreadPoolExecutorSubclassT
246      }
247  
248      /**
249 <     *   getCompletedTaskCount increases, but doesn't overestimate,
250 <     *   when tasks complete
249 >     * getCompletedTaskCount increases, but doesn't overestimate,
250 >     * when tasks complete
251       */
252      public void testGetCompletedTaskCount() throws InterruptedException {
253          ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 260 | Line 260 | public class ThreadPoolExecutorSubclassT
260      }
261  
262      /**
263 <     *   getCorePoolSize returns size given in constructor if not otherwise set
263 >     * getCorePoolSize returns size given in constructor if not otherwise set
264       */
265      public void testGetCorePoolSize() {
266          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 269 | Line 269 | public class ThreadPoolExecutorSubclassT
269      }
270  
271      /**
272 <     *   getKeepAliveTime returns value given in constructor if not otherwise set
272 >     * getKeepAliveTime returns value given in constructor if not otherwise set
273       */
274      public void testGetKeepAliveTime() {
275          ThreadPoolExecutor p2 = new CustomTPE(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 353 | Line 353 | public class ThreadPoolExecutorSubclassT
353  
354  
355      /**
356 <     *   getLargestPoolSize increases, but doesn't overestimate, when
357 <     *   multiple threads active
356 >     * getLargestPoolSize increases, but doesn't overestimate, when
357 >     * multiple threads active
358       */
359      public void testGetLargestPoolSize() throws InterruptedException {
360          ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 367 | Line 367 | public class ThreadPoolExecutorSubclassT
367      }
368  
369      /**
370 <     *   getMaximumPoolSize returns value given in constructor if not
371 <     *   otherwise set
370 >     * getMaximumPoolSize returns value given in constructor if not
371 >     * otherwise set
372       */
373      public void testGetMaximumPoolSize() {
374          ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 377 | Line 377 | public class ThreadPoolExecutorSubclassT
377      }
378  
379      /**
380 <     *   getPoolSize increases, but doesn't overestimate, when threads
381 <     *   become active
380 >     * getPoolSize increases, but doesn't overestimate, when threads
381 >     * become active
382       */
383      public void testGetPoolSize() {
384          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 389 | Line 389 | public class ThreadPoolExecutorSubclassT
389      }
390  
391      /**
392 <     *  getTaskCount increases, but doesn't overestimate, when tasks submitted
392 >     * getTaskCount increases, but doesn't overestimate, when tasks submitted
393       */
394      public void testGetTaskCount() throws InterruptedException {
395          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 401 | Line 401 | public class ThreadPoolExecutorSubclassT
401      }
402  
403      /**
404 <     *   isShutDown is false before shutdown, true after
404 >     * isShutDown is false before shutdown, true after
405       */
406      public void testIsShutdown() {
407  
# Line 414 | Line 414 | public class ThreadPoolExecutorSubclassT
414  
415  
416      /**
417 <     *  isTerminated is false before termination, true after
417 >     * isTerminated is false before termination, true after
418       */
419      public void testIsTerminated() throws InterruptedException {
420          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 429 | Line 429 | public class ThreadPoolExecutorSubclassT
429      }
430  
431      /**
432 <     *  isTerminating is not true when running or when terminated
432 >     * isTerminating is not true when running or when terminated
433       */
434      public void testIsTerminating() throws InterruptedException {
435          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 498 | Line 498 | public class ThreadPoolExecutorSubclassT
498      }
499  
500      /**
501 <     *   purge removes cancelled tasks from the queue
501 >     * purge removes cancelled tasks from the queue
502       */
503      public void testPurge() {
504          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 516 | Line 516 | public class ThreadPoolExecutorSubclassT
516      }
517  
518      /**
519 <     *  shutDownNow returns a list containing tasks that were not run
519 >     * shutDownNow returns a list containing tasks that were not run
520       */
521      public void testShutDownNow() {
522          ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 827 | Line 827 | public class ThreadPoolExecutorSubclassT
827  
828  
829      /**
830 <     *  execute throws RejectedExecutionException
831 <     *  if saturated.
830 >     * execute throws RejectedExecutionException if saturated.
831       */
832      public void testSaturatedExecute() {
833          ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1));
# Line 843 | Line 842 | public class ThreadPoolExecutorSubclassT
842      }
843  
844      /**
845 <     *  executor using CallerRunsPolicy runs task if saturated.
845 >     * executor using CallerRunsPolicy runs task if saturated.
846       */
847      public void testSaturatedExecute2() {
848          RejectedExecutionHandler h = new CustomTPE.CallerRunsPolicy();
# Line 869 | Line 868 | public class ThreadPoolExecutorSubclassT
868      }
869  
870      /**
871 <     *  executor using DiscardPolicy drops task if saturated.
871 >     * executor using DiscardPolicy drops task if saturated.
872       */
873      public void testSaturatedExecute3() {
874          RejectedExecutionHandler h = new CustomTPE.DiscardPolicy();
# Line 894 | Line 893 | public class ThreadPoolExecutorSubclassT
893      }
894  
895      /**
896 <     *  executor using DiscardOldestPolicy drops oldest task if saturated.
896 >     * executor using DiscardOldestPolicy drops oldest task if saturated.
897       */
898      public void testSaturatedExecute4() {
899          RejectedExecutionHandler h = new CustomTPE.DiscardOldestPolicy();
# Line 915 | Line 914 | public class ThreadPoolExecutorSubclassT
914      }
915  
916      /**
917 <     *  execute throws RejectedExecutionException if shutdown
917 >     * execute throws RejectedExecutionException if shutdown
918       */
919      public void testRejectedExecutionExceptionOnShutdown() {
920          ThreadPoolExecutor tpe =
# Line 930 | Line 929 | public class ThreadPoolExecutorSubclassT
929      }
930  
931      /**
932 <     *  execute using CallerRunsPolicy drops task on shutdown
932 >     * execute using CallerRunsPolicy drops task on shutdown
933       */
934      public void testCallerRunsOnShutdown() {
935          RejectedExecutionHandler h = new CustomTPE.CallerRunsPolicy();
# Line 947 | Line 946 | public class ThreadPoolExecutorSubclassT
946      }
947  
948      /**
949 <     *  execute using DiscardPolicy drops task on shutdown
949 >     * execute using DiscardPolicy drops task on shutdown
950       */
951      public void testDiscardOnShutdown() {
952          RejectedExecutionHandler h = new CustomTPE.DiscardPolicy();
# Line 965 | Line 964 | public class ThreadPoolExecutorSubclassT
964  
965  
966      /**
967 <     *  execute using DiscardOldestPolicy drops task on shutdown
967 >     * execute using DiscardOldestPolicy drops task on shutdown
968       */
969      public void testDiscardOldestOnShutdown() {
970          RejectedExecutionHandler h = new CustomTPE.DiscardOldestPolicy();
# Line 997 | Line 996 | public class ThreadPoolExecutorSubclassT
996      }
997  
998      /**
999 <     *  setCorePoolSize of negative value throws IllegalArgumentException
999 >     * setCorePoolSize of negative value throws IllegalArgumentException
1000       */
1001      public void testCorePoolSizeIllegalArgumentException() {
1002          ThreadPoolExecutor tpe =
# Line 1013 | Line 1012 | public class ThreadPoolExecutorSubclassT
1012      }
1013  
1014      /**
1015 <     *  setMaximumPoolSize(int) throws IllegalArgumentException if
1016 <     *  given a value less the core pool size
1015 >     * setMaximumPoolSize(int) throws IllegalArgumentException
1016 >     * if given a value less the core pool size
1017       */
1018      public void testMaximumPoolSizeIllegalArgumentException() {
1019          ThreadPoolExecutor tpe =
# Line 1030 | Line 1029 | public class ThreadPoolExecutorSubclassT
1029      }
1030  
1031      /**
1032 <     *  setMaximumPoolSize throws IllegalArgumentException
1033 <     *  if given a negative value
1032 >     * setMaximumPoolSize throws IllegalArgumentException
1033 >     * if given a negative value
1034       */
1035      public void testMaximumPoolSizeIllegalArgumentException2() {
1036          ThreadPoolExecutor tpe =
# Line 1048 | Line 1047 | public class ThreadPoolExecutorSubclassT
1047  
1048  
1049      /**
1050 <     *  setKeepAliveTime  throws IllegalArgumentException
1051 <     *  when given a negative value
1050 >     * setKeepAliveTime throws IllegalArgumentException
1051 >     * when given a negative value
1052       */
1053      public void testKeepAliveTimeIllegalArgumentException() {
1054          ThreadPoolExecutor tpe =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines