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

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

# Line 48 | Line 48 | public class ThreadPoolExecutorTest exte
48  
49  
50      /**
51 <     *  execute successfully executes a runnable
51 >     * execute successfully executes a runnable
52       */
53      public void testExecute() throws InterruptedException {
54          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 61 | Line 61 | public class ThreadPoolExecutorTest exte
61      }
62  
63      /**
64 <     *  getActiveCount increases but doesn't overestimate, when a
65 <     *  thread becomes active
64 >     * getActiveCount increases but doesn't overestimate, when a
65 >     * thread becomes active
66       */
67      public void testGetActiveCount() throws InterruptedException {
68          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 74 | Line 74 | public class ThreadPoolExecutorTest exte
74      }
75  
76      /**
77 <     *  prestartCoreThread starts a thread if under corePoolSize, else doesn't
77 >     * prestartCoreThread starts a thread if under corePoolSize, else doesn't
78       */
79      public void testPrestartCoreThread() {
80          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 89 | Line 89 | public class ThreadPoolExecutorTest exte
89      }
90  
91      /**
92 <     *  prestartAllCoreThreads starts all corePoolSize threads
92 >     * prestartAllCoreThreads starts all corePoolSize threads
93       */
94      public void testPrestartAllCoreThreads() {
95          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 102 | Line 102 | public class ThreadPoolExecutorTest exte
102      }
103  
104      /**
105 <     *   getCompletedTaskCount increases, but doesn't overestimate,
106 <     *   when tasks complete
105 >     * getCompletedTaskCount increases, but doesn't overestimate,
106 >     * when tasks complete
107       */
108      public void testGetCompletedTaskCount() throws InterruptedException {
109          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 116 | Line 116 | public class ThreadPoolExecutorTest exte
116      }
117  
118      /**
119 <     *   getCorePoolSize returns size given in constructor if not otherwise set
119 >     * getCorePoolSize returns size given in constructor if not otherwise set
120       */
121      public void testGetCorePoolSize() {
122          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 125 | Line 125 | public class ThreadPoolExecutorTest exte
125      }
126  
127      /**
128 <     *   getKeepAliveTime returns value given in constructor if not otherwise set
128 >     * getKeepAliveTime returns value given in constructor if not otherwise set
129       */
130      public void testGetKeepAliveTime() {
131          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 209 | Line 209 | public class ThreadPoolExecutorTest exte
209  
210  
211      /**
212 <     *   getLargestPoolSize increases, but doesn't overestimate, when
213 <     *   multiple threads active
212 >     * getLargestPoolSize increases, but doesn't overestimate, when
213 >     * multiple threads active
214       */
215      public void testGetLargestPoolSize() throws InterruptedException {
216          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 223 | Line 223 | public class ThreadPoolExecutorTest exte
223      }
224  
225      /**
226 <     *   getMaximumPoolSize returns value given in constructor if not
227 <     *   otherwise set
226 >     * getMaximumPoolSize returns value given in constructor if not
227 >     * otherwise set
228       */
229      public void testGetMaximumPoolSize() {
230          ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 233 | Line 233 | public class ThreadPoolExecutorTest exte
233      }
234  
235      /**
236 <     *   getPoolSize increases, but doesn't overestimate, when threads
237 <     *   become active
236 >     * getPoolSize increases, but doesn't overestimate, when threads
237 >     * become active
238       */
239      public void testGetPoolSize() {
240          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 245 | Line 245 | public class ThreadPoolExecutorTest exte
245      }
246  
247      /**
248 <     *  getTaskCount increases, but doesn't overestimate, when tasks submitted
248 >     * getTaskCount increases, but doesn't overestimate, when tasks submitted
249       */
250      public void testGetTaskCount() throws InterruptedException {
251          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 257 | Line 257 | public class ThreadPoolExecutorTest exte
257      }
258  
259      /**
260 <     *   isShutDown is false before shutdown, true after
260 >     * isShutDown is false before shutdown, true after
261       */
262      public void testIsShutdown() {
263  
# Line 270 | Line 270 | public class ThreadPoolExecutorTest exte
270  
271  
272      /**
273 <     *  isTerminated is false before termination, true after
273 >     * isTerminated is false before termination, true after
274       */
275      public void testIsTerminated() throws InterruptedException {
276          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 285 | Line 285 | public class ThreadPoolExecutorTest exte
285      }
286  
287      /**
288 <     *  isTerminating is not true when running or when terminated
288 >     * isTerminating is not true when running or when terminated
289       */
290      public void testIsTerminating() throws InterruptedException {
291          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 354 | Line 354 | public class ThreadPoolExecutorTest exte
354      }
355  
356      /**
357 <     *   purge removes cancelled tasks from the queue
357 >     * purge removes cancelled tasks from the queue
358       */
359      public void testPurge() {
360          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 372 | Line 372 | public class ThreadPoolExecutorTest exte
372      }
373  
374      /**
375 <     *  shutDownNow returns a list containing tasks that were not run
375 >     * shutDownNow returns a list containing tasks that were not run
376       */
377      public void testShutDownNow() {
378          ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
# Line 683 | Line 683 | public class ThreadPoolExecutorTest exte
683  
684  
685      /**
686 <     *  execute throws RejectedExecutionException
687 <     *  if saturated.
686 >     * execute throws RejectedExecutionException if saturated.
687       */
688      public void testSaturatedExecute() {
689          ThreadPoolExecutor p =
# Line 706 | Line 705 | public class ThreadPoolExecutorTest exte
705      }
706  
707      /**
708 <     *  executor using CallerRunsPolicy runs task if saturated.
708 >     * executor using CallerRunsPolicy runs task if saturated.
709       */
710      public void testSaturatedExecute2() {
711          RejectedExecutionHandler h = new ThreadPoolExecutor.CallerRunsPolicy();
# Line 732 | Line 731 | public class ThreadPoolExecutorTest exte
731      }
732  
733      /**
734 <     *  executor using DiscardPolicy drops task if saturated.
734 >     * executor using DiscardPolicy drops task if saturated.
735       */
736      public void testSaturatedExecute3() {
737          RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardPolicy();
# Line 757 | Line 756 | public class ThreadPoolExecutorTest exte
756      }
757  
758      /**
759 <     *  executor using DiscardOldestPolicy drops oldest task if saturated.
759 >     * executor using DiscardOldestPolicy drops oldest task if saturated.
760       */
761      public void testSaturatedExecute4() {
762          RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardOldestPolicy();
# Line 778 | Line 777 | public class ThreadPoolExecutorTest exte
777      }
778  
779      /**
780 <     *  execute throws RejectedExecutionException if shutdown
780 >     * execute throws RejectedExecutionException if shutdown
781       */
782      public void testRejectedExecutionExceptionOnShutdown() {
783          ThreadPoolExecutor tpe =
# Line 793 | Line 792 | public class ThreadPoolExecutorTest exte
792      }
793  
794      /**
795 <     *  execute using CallerRunsPolicy drops task on shutdown
795 >     * execute using CallerRunsPolicy drops task on shutdown
796       */
797      public void testCallerRunsOnShutdown() {
798          RejectedExecutionHandler h = new ThreadPoolExecutor.CallerRunsPolicy();
# Line 810 | Line 809 | public class ThreadPoolExecutorTest exte
809      }
810  
811      /**
812 <     *  execute using DiscardPolicy drops task on shutdown
812 >     * execute using DiscardPolicy drops task on shutdown
813       */
814      public void testDiscardOnShutdown() {
815          RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardPolicy();
# Line 828 | Line 827 | public class ThreadPoolExecutorTest exte
827  
828  
829      /**
830 <     *  execute using DiscardOldestPolicy drops task on shutdown
830 >     * execute using DiscardOldestPolicy drops task on shutdown
831       */
832      public void testDiscardOldestOnShutdown() {
833          RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardOldestPolicy();
# Line 877 | Line 876 | public class ThreadPoolExecutorTest exte
876      }
877  
878      /**
879 <     *  setMaximumPoolSize(int) throws IllegalArgumentException if
880 <     *  given a value less the core pool size
879 >     * setMaximumPoolSize(int) throws IllegalArgumentException if
880 >     * given a value less the core pool size
881       */
882      public void testMaximumPoolSizeIllegalArgumentException() {
883          ThreadPoolExecutor tpe =
# Line 896 | Line 895 | public class ThreadPoolExecutorTest exte
895      }
896  
897      /**
898 <     *  setMaximumPoolSize throws IllegalArgumentException
899 <     *  if given a negative value
898 >     * setMaximumPoolSize throws IllegalArgumentException
899 >     * if given a negative value
900       */
901      public void testMaximumPoolSizeIllegalArgumentException2() {
902          ThreadPoolExecutor tpe =
# Line 916 | Line 915 | public class ThreadPoolExecutorTest exte
915  
916  
917      /**
918 <     *  setKeepAliveTime  throws IllegalArgumentException
919 <     *  when given a negative value
918 >     * setKeepAliveTime throws IllegalArgumentException
919 >     * when given a negative value
920       */
921      public void testKeepAliveTimeIllegalArgumentException() {
922          ThreadPoolExecutor tpe =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines