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.11 by jsr166, Sat Nov 21 19:31:58 2009 UTC vs.
Revision 1.16 by jsr166, Tue Dec 1 09:48:12 2009 UTC

# Line 529 | Line 529 | public class ThreadPoolExecutorSubclassT
529              try {
530                  l = p1.shutdownNow();
531              } catch (SecurityException ok) { return; }
532
532          }
533          assertTrue(p1.isShutdown());
534          assertTrue(l.size() <= 4);
# Line 1201 | Line 1200 | public class ThreadPoolExecutorSubclassT
1200              e.invokeAny(l);
1201              shouldThrow();
1202          } catch (ExecutionException success) {
1203 +            assertTrue(success.getCause() instanceof NullPointerException);
1204          } finally {
1205              joinPool(e);
1206          }
# Line 1280 | Line 1280 | public class ThreadPoolExecutorSubclassT
1280                  future.get();
1281              shouldThrow();
1282          } catch (ExecutionException success) {
1283 +            assertTrue(success.getCause() instanceof NullPointerException);
1284          } finally {
1285              joinPool(e);
1286          }
# Line 1353 | Line 1354 | public class ThreadPoolExecutorSubclassT
1354       * timed invokeAny(c) throws NPE if c has null elements
1355       */
1356      public void testTimedInvokeAny3() throws Exception {
1357 +        final CountDownLatch latch = new CountDownLatch(1);
1358          ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
1359          try {
1360              ArrayList<Callable<String>> l = new ArrayList<Callable<String>>();
# Line 1368 | Line 1370 | public class ThreadPoolExecutorSubclassT
1370              shouldThrow();
1371          } catch (NullPointerException success) {
1372          } finally {
1373 +            latch.countDown();
1374              joinPool(e);
1375          }
1376      }
# Line 1383 | Line 1386 | public class ThreadPoolExecutorSubclassT
1386              e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
1387              shouldThrow();
1388          } catch (ExecutionException success) {
1389 +            assertTrue(success.getCause() instanceof NullPointerException);
1390          } finally {
1391              joinPool(e);
1392          }
# Line 1497 | Line 1501 | public class ThreadPoolExecutorSubclassT
1501              assertEquals(2, result.size());
1502              for (Future<String> future : result)
1503                  assertSame(TEST_STRING, future.get());
1500        } catch (ExecutionException success) {
1504          } finally {
1505              joinPool(e);
1506          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines