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

Comparing jsr166/src/test/tck/ScheduledExecutorTest.java (file contents):
Revision 1.80 by jsr166, Mon Feb 22 23:16:06 2016 UTC vs.
Revision 1.82 by jsr166, Thu Sep 15 17:31:16 2016 UTC

# Line 18 | Line 18 | import java.util.concurrent.Callable;
18   import java.util.concurrent.CancellationException;
19   import java.util.concurrent.CountDownLatch;
20   import java.util.concurrent.ExecutionException;
21 import java.util.concurrent.Executors;
21   import java.util.concurrent.ExecutorService;
22   import java.util.concurrent.Future;
23   import java.util.concurrent.RejectedExecutionException;
# Line 511 | Line 510 | public class ScheduledExecutorTest exten
510       * isShutdown is false before shutdown, true after
511       */
512      public void testIsShutdown() {
514
513          final ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
514 <        try {
515 <            assertFalse(p.isShutdown());
516 <        }
517 <        finally {
518 <            try { p.shutdown(); } catch (SecurityException ok) { return; }
514 >        assertFalse(p.isShutdown());
515 >        try (PoolCleaner cleaner = cleaner(p)) {
516 >            try {
517 >                p.shutdown();
518 >                assertTrue(p.isShutdown());
519 >            } catch (SecurityException ok) {}
520          }
522        assertTrue(p.isShutdown());
521      }
522  
523      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines