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

Comparing jsr166/src/test/tck/ForkJoinPool8Test.java (file contents):
Revision 1.35 by jsr166, Sat Mar 18 18:20:00 2017 UTC vs.
Revision 1.36 by jsr166, Mon May 29 19:15:02 2017 UTC

# Line 5 | Line 5
5   */
6  
7   import static java.util.concurrent.TimeUnit.MILLISECONDS;
8 import static java.util.concurrent.TimeUnit.SECONDS;
8  
9   import java.util.HashSet;
10   import java.util.concurrent.CancellationException;
# Line 84 | Line 83 | public class ForkJoinPool8Test extends J
83  
84              Thread.currentThread().interrupt();
85              try {
86 <                a.get(5L, SECONDS);
86 >                a.get(randomTimeout(), randomTimeUnit());
87                  shouldThrow();
88              } catch (InterruptedException success) {
89              } catch (Throwable fail) { threadUnexpectedException(fail); }
90          }
91  
92          try {
93 <            a.get(0L, SECONDS);
93 >            a.get(randomExpiredTimeout(), randomTimeUnit());
94              shouldThrow();
95          } catch (TimeoutException success) {
96          } catch (Throwable fail) { threadUnexpectedException(fail); }
# Line 109 | Line 108 | public class ForkJoinPool8Test extends J
108          assertFalse(a.cancel(true));
109          try {
110              assertNull(a.get());
111 <        } catch (Throwable fail) { threadUnexpectedException(fail); }
113 <        try {
114 <            assertNull(a.get(5L, SECONDS));
111 >            assertNull(a.get(randomTimeout(), randomTimeUnit()));
112          } catch (Throwable fail) { threadUnexpectedException(fail); }
113      }
114  
# Line 136 | Line 133 | public class ForkJoinPool8Test extends J
133          } catch (Throwable fail) { threadUnexpectedException(fail); }
134  
135          try {
136 <            a.get(5L, SECONDS);
136 >            a.get(randomTimeout(), randomTimeUnit());
137              shouldThrow();
138          } catch (CancellationException success) {
139          } catch (Throwable fail) { threadUnexpectedException(fail); }
# Line 167 | Line 164 | public class ForkJoinPool8Test extends J
164          } catch (Throwable fail) { threadUnexpectedException(fail); }
165  
166          try {
167 <            a.get(5L, SECONDS);
167 >            a.get(randomTimeout(), randomTimeUnit());
168              shouldThrow();
169          } catch (ExecutionException success) {
170              assertSame(t.getClass(), success.getCause().getClass());
# Line 356 | Line 353 | public class ForkJoinPool8Test extends J
353              protected void realCompute() throws Exception {
354                  FibAction f = new FibAction(8);
355                  assertSame(f, f.fork());
356 <                assertNull(f.get(5L, SECONDS));
356 >                assertNull(f.get(LONG_DELAY_MS, MILLISECONDS));
357                  assertEquals(21, f.result);
358                  checkCompletedNormally(f);
359              }};
# Line 372 | Line 369 | public class ForkJoinPool8Test extends J
369                  FibAction f = new FibAction(8);
370                  assertSame(f, f.fork());
371                  try {
372 <                    f.get(5L, null);
372 >                    f.get(randomTimeout(), null);
373                      shouldThrow();
374                  } catch (NullPointerException success) {}
375              }};
# Line 472 | Line 469 | public class ForkJoinPool8Test extends J
469                  FailingFibAction f = new FailingFibAction(8);
470                  assertSame(f, f.fork());
471                  try {
472 <                    f.get(5L, SECONDS);
472 >                    f.get(LONG_DELAY_MS, MILLISECONDS);
473                      shouldThrow();
474                  } catch (ExecutionException success) {
475                      Throwable cause = success.getCause();
# Line 564 | Line 561 | public class ForkJoinPool8Test extends J
561                  assertTrue(f.cancel(true));
562                  assertSame(f, f.fork());
563                  try {
564 <                    f.get(5L, SECONDS);
564 >                    f.get(LONG_DELAY_MS, MILLISECONDS);
565                      shouldThrow();
566                  } catch (CancellationException success) {
567                      checkCancelled(f);
# Line 1040 | Line 1037 | public class ForkJoinPool8Test extends J
1037                  CCF f = new LCCF(null, 8);
1038                  assertSame(f, f.fork());
1039                  try {
1040 <                    f.get(5L, null);
1040 >                    f.get(randomTimeout(), null);
1041                      shouldThrow();
1042                  } catch (NullPointerException success) {}
1043              }};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines