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

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.86 by jsr166, Mon Jun 16 21:04:23 2014 UTC vs.
Revision 1.87 by jsr166, Mon Jun 16 21:14:16 2014 UTC

# Line 3009 | Line 3009 | public class CompletableFutureTest exten
3009      public void testAnyOf_exceptional() throws Exception {
3010          for (int k = 0; k < 10; k++) {
3011              CompletableFuture[] fs = new CompletableFuture[k];
3012 <            for (int i = 0; i < k; i++)
3012 >            CFException[] exs = new CFException[k];
3013 >            for (int i = 0; i < k; i++) {
3014                  fs[i] = new CompletableFuture<>();
3015 +                exs[i] = new CFException();
3016 +            }
3017              CompletableFuture<Object> f = CompletableFuture.anyOf(fs);
3018              checkIncomplete(f);
3019              for (int i = 0; i < k; i++) {
3020 <                fs[i].completeExceptionally(new CFException());
3021 <                checkCompletedWithWrappedCFException(f);
3020 >                fs[i].completeExceptionally(exs[i]);
3021 >                checkCompletedWithWrappedException(f, exs[0]);
3022 >                checkCompletedWithWrappedCFException(CompletableFuture.anyOf(fs));
3023 >            }
3024 >        }
3025 >    }
3026 >
3027 >    public void testAnyOf_exceptional_backwards() throws Exception {
3028 >        for (int k = 0; k < 10; k++) {
3029 >            CompletableFuture[] fs = new CompletableFuture[k];
3030 >            CFException[] exs = new CFException[k];
3031 >            for (int i = 0; i < k; i++) {
3032 >                fs[i] = new CompletableFuture<>();
3033 >                exs[i] = new CFException();
3034 >            }
3035 >            CompletableFuture<Object> f = CompletableFuture.anyOf(fs);
3036 >            checkIncomplete(f);
3037 >            for (int i = k - 1; i >= 0; i--) {
3038 >                fs[i].completeExceptionally(exs[i]);
3039 >                checkCompletedWithWrappedException(f, exs[k - 1]);
3040                  checkCompletedWithWrappedCFException(CompletableFuture.anyOf(fs));
3041              }
3042          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines