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

Comparing jsr166/src/test/tck/ForkJoinTaskTest.java (file contents):
Revision 1.3 by jsr166, Sat Aug 1 22:09:13 2009 UTC vs.
Revision 1.6 by jsr166, Tue Dec 1 06:47:14 2009 UTC

# Line 11 | Line 11 | import java.util.*;
11   public class ForkJoinTaskTest extends JSR166TestCase {
12  
13      public static void main(String[] args) {
14 <        junit.textui.TestRunner.run (suite());
14 >        junit.textui.TestRunner.run (suite());
15      }
16      public static Test suite() {
17 <        return new TestSuite(ForkJoinTaskTest.class);
17 >        return new TestSuite(ForkJoinTaskTest.class);
18      }
19  
20      /**
# Line 148 | Line 148 | public class ForkJoinTaskTest extends JS
148  
149      }
150  
151 <    static final class AsyncFib  extends BinaryAsyncAction {
151 >    static final class AsyncFib extends BinaryAsyncAction {
152          int number;
153          public AsyncFib(int n) {
154              this.number = n;
# Line 177 | Line 177 | public class ForkJoinTaskTest extends JS
177      }
178  
179  
180 <    static final class FailingAsyncFib  extends BinaryAsyncAction {
180 >    static final class FailingAsyncFib extends BinaryAsyncAction {
181          int number;
182          public FailingAsyncFib(int n) {
183              this.number = n;
# Line 276 | Line 276 | public class ForkJoinTaskTest extends JS
276                          threadAssertTrue(f.number == 21);
277                          threadAssertTrue(f.isDone());
278                      } catch (Exception ex) {
279 <                        unexpectedException();
279 >                        unexpectedException(ex);
280                      }
281                  }
282              };
# Line 296 | Line 296 | public class ForkJoinTaskTest extends JS
296                          threadAssertTrue(f.number == 21);
297                          threadAssertTrue(f.isDone());
298                      } catch (Exception ex) {
299 <                        unexpectedException();
299 >                        unexpectedException(ex);
300                      }
301                  }
302              };
# Line 313 | Line 313 | public class ForkJoinTaskTest extends JS
313                          AsyncFib f = new AsyncFib(8);
314                          f.fork();
315                          f.get(5L, null);
316 +                        shouldThrow();
317                      } catch (NullPointerException success) {
318                      } catch (Exception ex) {
319 <                        unexpectedException();
319 >                        unexpectedException(ex);
320                      }
321                  }
322              };
# Line 451 | Line 452 | public class ForkJoinTaskTest extends JS
452                          f.fork();
453                          f.get();
454                          shouldThrow();
455 <                    } catch (Exception success) {
455 >                    } catch (ExecutionException success) {
456 >                    } catch (Exception ex) {
457 >                        unexpectedException(ex);
458                      }
459                  }
460              };
# Line 469 | Line 472 | public class ForkJoinTaskTest extends JS
472                          f.fork();
473                          f.get(5L, TimeUnit.SECONDS);
474                          shouldThrow();
475 <                    } catch (Exception success) {
475 >                    } catch (ExecutionException success) {
476 >                    } catch (Exception ex) {
477 >                        unexpectedException(ex);
478                      }
479                  }
480              };
# Line 581 | Line 586 | public class ForkJoinTaskTest extends JS
586                          f.fork();
587                          f.get();
588                          shouldThrow();
589 <                    } catch (Exception success) {
589 >                    } catch (CancellationException success) {
590 >                    } catch (Exception ex) {
591 >                        unexpectedException(ex);
592                      }
593                  }
594              };
# Line 600 | Line 607 | public class ForkJoinTaskTest extends JS
607                          f.fork();
608                          f.get(5L, TimeUnit.SECONDS);
609                          shouldThrow();
610 <                    } catch (Exception success) {
610 >                    } catch (CancellationException success) {
611 >                    } catch (Exception ex) {
612 >                        unexpectedException(ex);
613                      }
614                  }
615              };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines