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.58 by jsr166, Sun Oct 4 01:52:43 2015 UTC vs.
Revision 1.59 by jsr166, Sun Oct 4 01:56:51 2015 UTC

# Line 354 | Line 354 | public class ThreadPoolExecutorSubclassT
354       * getCorePoolSize returns size given in constructor if not otherwise set
355       */
356      public void testGetCorePoolSize() {
357 <        ThreadPoolExecutor p =
357 >        final ThreadPoolExecutor p =
358              new CustomTPE(1, 1,
359                            LONG_DELAY_MS, MILLISECONDS,
360                            new ArrayBlockingQueue<Runnable>(10));
# Line 367 | Line 367 | public class ThreadPoolExecutorSubclassT
367       * getKeepAliveTime returns value given in constructor if not otherwise set
368       */
369      public void testGetKeepAliveTime() {
370 <        ThreadPoolExecutor p =
370 >        final ThreadPoolExecutor p =
371              new CustomTPE(2, 2,
372                            1000, MILLISECONDS,
373                            new ArrayBlockingQueue<Runnable>(10));
# Line 380 | Line 380 | public class ThreadPoolExecutorSubclassT
380       * getThreadFactory returns factory in constructor if not set
381       */
382      public void testGetThreadFactory() {
383 <        ThreadFactory threadFactory = new SimpleThreadFactory();
384 <        ThreadPoolExecutor p =
383 >        final ThreadFactory threadFactory = new SimpleThreadFactory();
384 >        final ThreadPoolExecutor p =
385              new CustomTPE(1, 2,
386                            LONG_DELAY_MS, MILLISECONDS,
387                            new ArrayBlockingQueue<Runnable>(10),
# Line 396 | Line 396 | public class ThreadPoolExecutorSubclassT
396       * setThreadFactory sets the thread factory returned by getThreadFactory
397       */
398      public void testSetThreadFactory() {
399 <        ThreadPoolExecutor p =
399 >        final ThreadPoolExecutor p =
400              new CustomTPE(1, 2,
401                            LONG_DELAY_MS, MILLISECONDS,
402                            new ArrayBlockingQueue<Runnable>(10));
# Line 411 | Line 411 | public class ThreadPoolExecutorSubclassT
411       * setThreadFactory(null) throws NPE
412       */
413      public void testSetThreadFactoryNull() {
414 <        ThreadPoolExecutor p =
414 >        final ThreadPoolExecutor p =
415              new CustomTPE(1, 2,
416                            LONG_DELAY_MS, MILLISECONDS,
417                            new ArrayBlockingQueue<Runnable>(10));
# Line 427 | Line 427 | public class ThreadPoolExecutorSubclassT
427       * getRejectedExecutionHandler returns handler in constructor if not set
428       */
429      public void testGetRejectedExecutionHandler() {
430 <        RejectedExecutionHandler h = new NoOpREHandler();
431 <        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10), h);
432 <        assertSame(h, p.getRejectedExecutionHandler());
433 <        joinPool(p);
430 >        final RejectedExecutionHandler h = new NoOpREHandler();
431 >        final ThreadPoolExecutor p =
432 >            new CustomTPE(1, 2,
433 >                          LONG_DELAY_MS, MILLISECONDS,
434 >                          new ArrayBlockingQueue<Runnable>(10),
435 >                          h);
436 >        try (PoolCleaner cleaner = cleaner(p)) {
437 >            assertSame(h, p.getRejectedExecutionHandler());
438 >        }
439      }
440  
441      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines