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.72 by jsr166, Sun Oct 4 02:38:45 2015 UTC vs.
Revision 1.73 by jsr166, Sun Oct 4 02:49:18 2015 UTC

# Line 1124 | Line 1124 | public class ThreadPoolExecutorSubclassT
1124       * execute throws RejectedExecutionException if saturated.
1125       */
1126      public void testSaturatedExecute() {
1127 <        ThreadPoolExecutor p =
1127 >        final ThreadPoolExecutor p =
1128              new CustomTPE(1, 1,
1129                            LONG_DELAY_MS, MILLISECONDS,
1130                            new ArrayBlockingQueue<Runnable>(1));
1131 <        final CountDownLatch done = new CountDownLatch(1);
1132 <        try {
1131 >        try (PoolCleaner cleaner = cleaner(p)) {
1132 >            final CountDownLatch done = new CountDownLatch(1);
1133              Runnable task = new CheckedRunnable() {
1134                  public void realRun() throws InterruptedException {
1135                      done.await();
# Line 1143 | Line 1143 | public class ThreadPoolExecutorSubclassT
1143                  } catch (RejectedExecutionException success) {}
1144                  assertTrue(p.getTaskCount() <= 2);
1145              }
1146        } finally {
1146              done.countDown();
1148            joinPool(p);
1147          }
1148      }
1149  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines