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.76 by jsr166, Sun Oct 4 03:49:33 2015 UTC vs.
Revision 1.77 by jsr166, Sun Oct 4 03:51:35 2015 UTC

# Line 1236 | Line 1236 | public class ThreadPoolExecutorSubclassT
1236       * execute throws RejectedExecutionException if shutdown
1237       */
1238      public void testRejectedExecutionExceptionOnShutdown() {
1239 <        ThreadPoolExecutor p =
1240 <            new CustomTPE(1,1,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(1));
1239 >        final ThreadPoolExecutor p =
1240 >            new CustomTPE(1, 1,
1241 >                          LONG_DELAY_MS, MILLISECONDS,
1242 >                          new ArrayBlockingQueue<Runnable>(1));
1243          try { p.shutdown(); } catch (SecurityException ok) { return; }
1244 <        try {
1245 <            p.execute(new NoOpRunnable());
1246 <            shouldThrow();
1247 <        } catch (RejectedExecutionException success) {}
1248 <
1249 <        joinPool(p);
1244 >        try (PoolCleaner cleaner = cleaner(p)) {
1245 >            try {
1246 >                p.execute(new NoOpRunnable());
1247 >                shouldThrow();
1248 >            } catch (RejectedExecutionException success) {}
1249 >        }
1250      }
1251  
1252      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines