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

Comparing jsr166/src/test/tck/RecursiveActionTest.java (file contents):
Revision 1.20 by jsr166, Sun Nov 21 08:35:40 2010 UTC vs.
Revision 1.21 by jsr166, Sun Nov 21 19:06:53 2010 UTC

# Line 125 | Line 125 | public class RecursiveActionTest extends
125          } catch (Throwable fail) { threadUnexpectedException(fail); }
126      }
127  
128 <    void checkTaskThrew(RecursiveAction a, Throwable t) {
128 >    void checkCompletedAbnormally(RecursiveAction a, Throwable t) {
129          assertTrue(a.isDone());
130          assertFalse(a.isCancelled());
131          assertFalse(a.isCompletedNormally());
# Line 333 | Line 333 | public class RecursiveActionTest extends
333                      f.invoke();
334                      shouldThrow();
335                  } catch (FJException success) {
336 <                    checkTaskThrew(f, success);
336 >                    checkCompletedAbnormally(f, success);
337                  }
338              }};
339          testInvokeOnPool(mainPool(), a);
# Line 348 | Line 348 | public class RecursiveActionTest extends
348                  FailingFibAction f = new FailingFibAction(8);
349                  f.quietlyInvoke();
350                  assertTrue(f.getException() instanceof FJException);
351 <                checkTaskThrew(f, f.getException());
351 >                checkCompletedAbnormally(f, f.getException());
352              }};
353          testInvokeOnPool(mainPool(), a);
354      }
# Line 365 | Line 365 | public class RecursiveActionTest extends
365                      f.join();
366                      shouldThrow();
367                  } catch (FJException success) {
368 <                    checkTaskThrew(f, success);
368 >                    checkCompletedAbnormally(f, success);
369                  }
370              }};
371          testInvokeOnPool(mainPool(), a);
# Line 383 | Line 383 | public class RecursiveActionTest extends
383                      f.get();
384                      shouldThrow();
385                  } catch (ExecutionException success) {
386 <                    checkTaskThrew(f, success.getCause());
386 >                    Throwable cause = success.getCause();
387 >                    assertTrue(cause instanceof FJException);
388 >                    checkCompletedAbnormally(f, cause);
389                  }
390              }};
391          testInvokeOnPool(mainPool(), a);
# Line 401 | Line 403 | public class RecursiveActionTest extends
403                      f.get(5L, TimeUnit.SECONDS);
404                      shouldThrow();
405                  } catch (ExecutionException success) {
406 <                    checkTaskThrew(f, success.getCause());
406 >                    Throwable cause = success.getCause();
407 >                    assertTrue(cause instanceof FJException);
408 >                    checkCompletedAbnormally(f, cause);
409                  }
410              }};
411          testInvokeOnPool(mainPool(), a);
# Line 417 | Line 421 | public class RecursiveActionTest extends
421                  assertSame(f, f.fork());
422                  f.quietlyJoin();
423                  assertTrue(f.getException() instanceof FJException);
424 <                checkTaskThrew(f, f.getException());
424 >                checkCompletedAbnormally(f, f.getException());
425              }};
426          testInvokeOnPool(mainPool(), a);
427      }
# Line 630 | Line 634 | public class RecursiveActionTest extends
634                      f.invoke();
635                      shouldThrow();
636                  } catch (FJException success) {
637 <                    checkTaskThrew(f, success);
637 >                    checkCompletedAbnormally(f, success);
638                  }
639              }};
640          testInvokeOnPool(mainPool(), a);
# Line 762 | Line 766 | public class RecursiveActionTest extends
766                      invokeAll(f, g);
767                      shouldThrow();
768                  } catch (FJException success) {
769 <                    checkTaskThrew(g, success);
769 >                    checkCompletedAbnormally(g, success);
770                  }
771              }};
772          testInvokeOnPool(mainPool(), a);
# Line 779 | Line 783 | public class RecursiveActionTest extends
783                      invokeAll(g);
784                      shouldThrow();
785                  } catch (FJException success) {
786 <                    checkTaskThrew(g, success);
786 >                    checkCompletedAbnormally(g, success);
787                  }
788              }};
789          testInvokeOnPool(mainPool(), a);
# Line 798 | Line 802 | public class RecursiveActionTest extends
802                      invokeAll(f, g, h);
803                      shouldThrow();
804                  } catch (FJException success) {
805 <                    checkTaskThrew(g, success);
805 >                    checkCompletedAbnormally(g, success);
806                  }
807              }};
808          testInvokeOnPool(mainPool(), a);
# Line 821 | Line 825 | public class RecursiveActionTest extends
825                      invokeAll(set);
826                      shouldThrow();
827                  } catch (FJException success) {
828 <                    checkTaskThrew(f, success);
828 >                    checkCompletedAbnormally(f, success);
829                  }
830              }};
831          testInvokeOnPool(mainPool(), a);
# Line 861 | Line 865 | public class RecursiveActionTest extends
865                  assertSame(f, f.fork());
866                  assertTrue(getSurplusQueuedTaskCount() > 0);
867                  helpQuiesce();
868 +                assertEquals(0, getSurplusQueuedTaskCount());
869                  checkCompletedNormally(f);
870                  checkCompletedNormally(g);
871                  checkCompletedNormally(h);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines