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.80 by jsr166, Sun Oct 4 06:39:13 2015 UTC vs.
Revision 1.81 by jsr166, Sun Oct 4 06:45:29 2015 UTC

# Line 753 | Line 753 | public class ThreadPoolExecutorSubclassT
753          final int count = 5;
754          final AtomicInteger ran = new AtomicInteger(0);
755          final ThreadPoolExecutor p =
756 <            new CustomTPE(poolSize, poolSize, LONG_DELAY_MS, MILLISECONDS,
756 >            new CustomTPE(poolSize, poolSize,
757 >                          LONG_DELAY_MS, MILLISECONDS,
758                            new ArrayBlockingQueue<Runnable>(10));
759          CountDownLatch threadsStarted = new CountDownLatch(poolSize);
760          Runnable waiter = new CheckedRunnable() { public void realRun() {
# Line 1322 | Line 1323 | public class ThreadPoolExecutorSubclassT
1323       */
1324      public void testCorePoolSizeIllegalArgumentException() {
1325          final ThreadPoolExecutor p =
1326 <            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
1327 <        try {
1328 <            p.setCorePoolSize(-1);
1329 <            shouldThrow();
1330 <        } catch (IllegalArgumentException success) {
1331 <        } finally {
1332 <            try { p.shutdown(); } catch (SecurityException ok) { return; }
1326 >            new CustomTPE(1, 2,
1327 >                          LONG_DELAY_MS, MILLISECONDS,
1328 >                          new ArrayBlockingQueue<Runnable>(10));
1329 >        try (PoolCleaner cleaner = cleaner(p)) {
1330 >            try {
1331 >                p.setCorePoolSize(-1);
1332 >                shouldThrow();
1333 >            } catch (IllegalArgumentException success) {}
1334          }
1333        joinPool(p);
1335      }
1336  
1337      /**
# Line 1339 | Line 1340 | public class ThreadPoolExecutorSubclassT
1340       */
1341      public void testMaximumPoolSizeIllegalArgumentException() {
1342          final ThreadPoolExecutor p =
1343 <            new CustomTPE(2,3,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
1343 >            new CustomTPE(2, 3,
1344 >                          LONG_DELAY_MS, MILLISECONDS,
1345 >                          new ArrayBlockingQueue<Runnable>(10));
1346          try {
1347              p.setMaximumPoolSize(1);
1348              shouldThrow();
# Line 1356 | Line 1359 | public class ThreadPoolExecutorSubclassT
1359       */
1360      public void testMaximumPoolSizeIllegalArgumentException2() {
1361          final ThreadPoolExecutor p =
1362 <            new CustomTPE(2,3,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
1362 >            new CustomTPE(2, 3,
1363 >                          LONG_DELAY_MS,
1364 >                          MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
1365          try {
1366              p.setMaximumPoolSize(-1);
1367              shouldThrow();
# Line 1373 | Line 1378 | public class ThreadPoolExecutorSubclassT
1378       */
1379      public void testKeepAliveTimeIllegalArgumentException() {
1380          final ThreadPoolExecutor p =
1381 <            new CustomTPE(2,3,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
1381 >            new CustomTPE(2, 3,
1382 >                          LONG_DELAY_MS, MILLISECONDS,
1383 >                          new ArrayBlockingQueue<Runnable>(10));
1384  
1385          try {
1386              p.setKeepAliveTime(-1,MILLISECONDS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines