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.10 by jsr166, Sat Nov 21 17:38:05 2009 UTC vs.
Revision 1.13 by jsr166, Sat Nov 21 20:02:13 2009 UTC

# Line 1201 | Line 1201 | public class ThreadPoolExecutorSubclassT
1201              e.invokeAny(l);
1202              shouldThrow();
1203          } catch (ExecutionException success) {
1204 +            assertTrue(success.getCause() instanceof NullPointerException);
1205          } finally {
1206              joinPool(e);
1207          }
# 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>>();
1361 <            l.add(new StringTask());
1361 >            l.add(new Callable<String>() {
1362 >                      public String call() {
1363 >                          try {
1364 >                              latch.await();
1365 >                          } catch (InterruptedException ok) {}
1366 >                          return TEST_STRING;
1367 >                      }});
1368              l.add(null);
1369              e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
1370              shouldThrow();
1371          } catch (NullPointerException success) {
1372          } finally {
1373 +            latch.countDown();
1374              joinPool(e);
1375          }
1376      }
# Line 1377 | 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          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines