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.119 by jsr166, Mon May 29 22:44:27 2017 UTC vs.
Revision 1.120 by jsr166, Sat Jul 15 18:17:40 2017 UTC

# Line 2081 | Line 2081 | public class ThreadPoolExecutorTest exte
2081          }
2082      }
2083  
2084 +    public void testAbortPolicy() {
2085 +        final RejectedExecutionHandler handler =
2086 +            new ThreadPoolExecutor.AbortPolicy();
2087 +        final ThreadPoolExecutor p =
2088 +            new ThreadPoolExecutor(1, 1,
2089 +                                   LONG_DELAY_MS, MILLISECONDS,
2090 +                                   new ArrayBlockingQueue<Runnable>(10));
2091 +        final TrackedNoOpRunnable r = new TrackedNoOpRunnable();
2092 +        try {
2093 +            handler.rejectedExecution(r, p);
2094 +            shouldThrow();
2095 +        } catch (RejectedExecutionException success) {}
2096 +        assertFalse(r.done);
2097 +        assertEquals(0, p.getTaskCount());
2098 +        assertTrue(p.getQueue().isEmpty());
2099 +    }
2100 +
2101   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines