• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 The Guava Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.google.common.util.concurrent;
17 public class FuturesTest_gwt extends com.google.gwt.junit.client.GWTTestCase {
getModuleName()18 @Override public String getModuleName() {
19   return "com.google.common.util.concurrent.testModule";
20 }
testAllAsList()21 public void testAllAsList() throws Exception {
22   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
23   testCase.setUp();
24   Throwable failure = null;
25   try {
26     testCase.testAllAsList();
27   } catch (Throwable t) {
28     failure = t;
29   }
30   try {
31     testCase.tearDown();
32   } catch (Throwable t) {
33     if (failure == null) {
34       failure = t;
35     }
36   }
37   if (failure instanceof Exception) {
38     throw (Exception) failure;
39   }
40   if (failure instanceof Error) {
41     throw (Error) failure;
42   }
43   if (failure != null) {
44     throw new RuntimeException(failure);
45   }
46 }
47 
testAllAsList_cancelled()48 public void testAllAsList_cancelled() throws Exception {
49   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
50   testCase.setUp();
51   Throwable failure = null;
52   try {
53     testCase.testAllAsList_cancelled();
54   } catch (Throwable t) {
55     failure = t;
56   }
57   try {
58     testCase.tearDown();
59   } catch (Throwable t) {
60     if (failure == null) {
61       failure = t;
62     }
63   }
64   if (failure instanceof Exception) {
65     throw (Exception) failure;
66   }
67   if (failure instanceof Error) {
68     throw (Error) failure;
69   }
70   if (failure != null) {
71     throw new RuntimeException(failure);
72   }
73 }
74 
testAllAsList_doneFutures()75 public void testAllAsList_doneFutures() throws Exception {
76   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
77   testCase.setUp();
78   Throwable failure = null;
79   try {
80     testCase.testAllAsList_doneFutures();
81   } catch (Throwable t) {
82     failure = t;
83   }
84   try {
85     testCase.tearDown();
86   } catch (Throwable t) {
87     if (failure == null) {
88       failure = t;
89     }
90   }
91   if (failure instanceof Exception) {
92     throw (Exception) failure;
93   }
94   if (failure instanceof Error) {
95     throw (Error) failure;
96   }
97   if (failure != null) {
98     throw new RuntimeException(failure);
99   }
100 }
101 
testAllAsList_emptyArray()102 public void testAllAsList_emptyArray() throws Exception {
103   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
104   testCase.setUp();
105   Throwable failure = null;
106   try {
107     testCase.testAllAsList_emptyArray();
108   } catch (Throwable t) {
109     failure = t;
110   }
111   try {
112     testCase.tearDown();
113   } catch (Throwable t) {
114     if (failure == null) {
115       failure = t;
116     }
117   }
118   if (failure instanceof Exception) {
119     throw (Exception) failure;
120   }
121   if (failure instanceof Error) {
122     throw (Error) failure;
123   }
124   if (failure != null) {
125     throw new RuntimeException(failure);
126   }
127 }
128 
testAllAsList_emptyList()129 public void testAllAsList_emptyList() throws Exception {
130   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
131   testCase.setUp();
132   Throwable failure = null;
133   try {
134     testCase.testAllAsList_emptyList();
135   } catch (Throwable t) {
136     failure = t;
137   }
138   try {
139     testCase.tearDown();
140   } catch (Throwable t) {
141     if (failure == null) {
142       failure = t;
143     }
144   }
145   if (failure instanceof Exception) {
146     throw (Exception) failure;
147   }
148   if (failure instanceof Error) {
149     throw (Error) failure;
150   }
151   if (failure != null) {
152     throw new RuntimeException(failure);
153   }
154 }
155 
testAllAsList_error()156 public void testAllAsList_error() throws Exception {
157   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
158   testCase.setUp();
159   Throwable failure = null;
160   try {
161     testCase.testAllAsList_error();
162   } catch (Throwable t) {
163     failure = t;
164   }
165   try {
166     testCase.tearDown();
167   } catch (Throwable t) {
168     if (failure == null) {
169       failure = t;
170     }
171   }
172   if (failure instanceof Exception) {
173     throw (Exception) failure;
174   }
175   if (failure instanceof Error) {
176     throw (Error) failure;
177   }
178   if (failure != null) {
179     throw new RuntimeException(failure);
180   }
181 }
182 
testAllAsList_failure()183 public void testAllAsList_failure() throws Exception {
184   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
185   testCase.setUp();
186   Throwable failure = null;
187   try {
188     testCase.testAllAsList_failure();
189   } catch (Throwable t) {
190     failure = t;
191   }
192   try {
193     testCase.tearDown();
194   } catch (Throwable t) {
195     if (failure == null) {
196       failure = t;
197     }
198   }
199   if (failure instanceof Exception) {
200     throw (Exception) failure;
201   }
202   if (failure instanceof Error) {
203     throw (Error) failure;
204   }
205   if (failure != null) {
206     throw new RuntimeException(failure);
207   }
208 }
209 
testAllAsList_immediateFailure()210 public void testAllAsList_immediateFailure() throws Exception {
211   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
212   testCase.setUp();
213   Throwable failure = null;
214   try {
215     testCase.testAllAsList_immediateFailure();
216   } catch (Throwable t) {
217     failure = t;
218   }
219   try {
220     testCase.tearDown();
221   } catch (Throwable t) {
222     if (failure == null) {
223       failure = t;
224     }
225   }
226   if (failure instanceof Exception) {
227     throw (Exception) failure;
228   }
229   if (failure instanceof Error) {
230     throw (Error) failure;
231   }
232   if (failure != null) {
233     throw new RuntimeException(failure);
234   }
235 }
236 
testAllAsList_logging_error()237 public void testAllAsList_logging_error() throws Exception {
238   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
239   testCase.setUp();
240   Throwable failure = null;
241   try {
242     testCase.testAllAsList_logging_error();
243   } catch (Throwable t) {
244     failure = t;
245   }
246   try {
247     testCase.tearDown();
248   } catch (Throwable t) {
249     if (failure == null) {
250       failure = t;
251     }
252   }
253   if (failure instanceof Exception) {
254     throw (Exception) failure;
255   }
256   if (failure instanceof Error) {
257     throw (Error) failure;
258   }
259   if (failure != null) {
260     throw new RuntimeException(failure);
261   }
262 }
263 
testAllAsList_logging_exception()264 public void testAllAsList_logging_exception() throws Exception {
265   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
266   testCase.setUp();
267   Throwable failure = null;
268   try {
269     testCase.testAllAsList_logging_exception();
270   } catch (Throwable t) {
271     failure = t;
272   }
273   try {
274     testCase.tearDown();
275   } catch (Throwable t) {
276     if (failure == null) {
277       failure = t;
278     }
279   }
280   if (failure instanceof Exception) {
281     throw (Exception) failure;
282   }
283   if (failure instanceof Error) {
284     throw (Error) failure;
285   }
286   if (failure != null) {
287     throw new RuntimeException(failure);
288   }
289 }
290 
testAllAsList_logging_multipleExceptions_alreadyDone()291 public void testAllAsList_logging_multipleExceptions_alreadyDone() throws Exception {
292   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
293   testCase.setUp();
294   Throwable failure = null;
295   try {
296     testCase.testAllAsList_logging_multipleExceptions_alreadyDone();
297   } catch (Throwable t) {
298     failure = t;
299   }
300   try {
301     testCase.tearDown();
302   } catch (Throwable t) {
303     if (failure == null) {
304       failure = t;
305     }
306   }
307   if (failure instanceof Exception) {
308     throw (Exception) failure;
309   }
310   if (failure instanceof Error) {
311     throw (Error) failure;
312   }
313   if (failure != null) {
314     throw new RuntimeException(failure);
315   }
316 }
317 
testAllAsList_logging_multipleExceptions_doneLater()318 public void testAllAsList_logging_multipleExceptions_doneLater() throws Exception {
319   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
320   testCase.setUp();
321   Throwable failure = null;
322   try {
323     testCase.testAllAsList_logging_multipleExceptions_doneLater();
324   } catch (Throwable t) {
325     failure = t;
326   }
327   try {
328     testCase.tearDown();
329   } catch (Throwable t) {
330     if (failure == null) {
331       failure = t;
332     }
333   }
334   if (failure instanceof Exception) {
335     throw (Exception) failure;
336   }
337   if (failure instanceof Error) {
338     throw (Error) failure;
339   }
340   if (failure != null) {
341     throw new RuntimeException(failure);
342   }
343 }
344 
testAllAsList_logging_same_cause()345 public void testAllAsList_logging_same_cause() throws Exception {
346   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
347   testCase.setUp();
348   Throwable failure = null;
349   try {
350     testCase.testAllAsList_logging_same_cause();
351   } catch (Throwable t) {
352     failure = t;
353   }
354   try {
355     testCase.tearDown();
356   } catch (Throwable t) {
357     if (failure == null) {
358       failure = t;
359     }
360   }
361   if (failure instanceof Exception) {
362     throw (Exception) failure;
363   }
364   if (failure instanceof Error) {
365     throw (Error) failure;
366   }
367   if (failure != null) {
368     throw new RuntimeException(failure);
369   }
370 }
371 
testAllAsList_logging_same_exception()372 public void testAllAsList_logging_same_exception() throws Exception {
373   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
374   testCase.setUp();
375   Throwable failure = null;
376   try {
377     testCase.testAllAsList_logging_same_exception();
378   } catch (Throwable t) {
379     failure = t;
380   }
381   try {
382     testCase.tearDown();
383   } catch (Throwable t) {
384     if (failure == null) {
385       failure = t;
386     }
387   }
388   if (failure instanceof Exception) {
389     throw (Exception) failure;
390   }
391   if (failure instanceof Error) {
392     throw (Error) failure;
393   }
394   if (failure != null) {
395     throw new RuntimeException(failure);
396   }
397 }
398 
testAllAsList_logging_seenExceptionUpdateCancelRace()399 public void testAllAsList_logging_seenExceptionUpdateCancelRace() throws Exception {
400   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
401   testCase.setUp();
402   Throwable failure = null;
403   try {
404     testCase.testAllAsList_logging_seenExceptionUpdateCancelRace();
405   } catch (Throwable t) {
406     failure = t;
407   }
408   try {
409     testCase.tearDown();
410   } catch (Throwable t) {
411     if (failure == null) {
412       failure = t;
413     }
414   }
415   if (failure instanceof Exception) {
416     throw (Exception) failure;
417   }
418   if (failure instanceof Error) {
419     throw (Error) failure;
420   }
421   if (failure != null) {
422     throw new RuntimeException(failure);
423   }
424 }
425 
testAllAsList_logging_seenExceptionUpdateRace()426 public void testAllAsList_logging_seenExceptionUpdateRace() throws Exception {
427   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
428   testCase.setUp();
429   Throwable failure = null;
430   try {
431     testCase.testAllAsList_logging_seenExceptionUpdateRace();
432   } catch (Throwable t) {
433     failure = t;
434   }
435   try {
436     testCase.tearDown();
437   } catch (Throwable t) {
438     if (failure == null) {
439       failure = t;
440     }
441   }
442   if (failure instanceof Exception) {
443     throw (Exception) failure;
444   }
445   if (failure instanceof Error) {
446     throw (Error) failure;
447   }
448   if (failure != null) {
449     throw new RuntimeException(failure);
450   }
451 }
452 
testAllAsList_resultCancelled()453 public void testAllAsList_resultCancelled() throws Exception {
454   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
455   testCase.setUp();
456   Throwable failure = null;
457   try {
458     testCase.testAllAsList_resultCancelled();
459   } catch (Throwable t) {
460     failure = t;
461   }
462   try {
463     testCase.tearDown();
464   } catch (Throwable t) {
465     if (failure == null) {
466       failure = t;
467     }
468   }
469   if (failure instanceof Exception) {
470     throw (Exception) failure;
471   }
472   if (failure instanceof Error) {
473     throw (Error) failure;
474   }
475   if (failure != null) {
476     throw new RuntimeException(failure);
477   }
478 }
479 
testAllAsList_resultCancelledInterrupted_withSecondaryListFuture()480 public void testAllAsList_resultCancelledInterrupted_withSecondaryListFuture() throws Exception {
481   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
482   testCase.setUp();
483   Throwable failure = null;
484   try {
485     testCase.testAllAsList_resultCancelledInterrupted_withSecondaryListFuture();
486   } catch (Throwable t) {
487     failure = t;
488   }
489   try {
490     testCase.tearDown();
491   } catch (Throwable t) {
492     if (failure == null) {
493       failure = t;
494     }
495   }
496   if (failure instanceof Exception) {
497     throw (Exception) failure;
498   }
499   if (failure instanceof Error) {
500     throw (Error) failure;
501   }
502   if (failure != null) {
503     throw new RuntimeException(failure);
504   }
505 }
506 
testAllAsList_resultCancelled_withSecondaryListFuture()507 public void testAllAsList_resultCancelled_withSecondaryListFuture() throws Exception {
508   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
509   testCase.setUp();
510   Throwable failure = null;
511   try {
512     testCase.testAllAsList_resultCancelled_withSecondaryListFuture();
513   } catch (Throwable t) {
514     failure = t;
515   }
516   try {
517     testCase.tearDown();
518   } catch (Throwable t) {
519     if (failure == null) {
520       failure = t;
521     }
522   }
523   if (failure instanceof Exception) {
524     throw (Exception) failure;
525   }
526   if (failure instanceof Error) {
527     throw (Error) failure;
528   }
529   if (failure != null) {
530     throw new RuntimeException(failure);
531   }
532 }
533 
testAllAsList_resultInterrupted()534 public void testAllAsList_resultInterrupted() throws Exception {
535   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
536   testCase.setUp();
537   Throwable failure = null;
538   try {
539     testCase.testAllAsList_resultInterrupted();
540   } catch (Throwable t) {
541     failure = t;
542   }
543   try {
544     testCase.tearDown();
545   } catch (Throwable t) {
546     if (failure == null) {
547       failure = t;
548     }
549   }
550   if (failure instanceof Exception) {
551     throw (Exception) failure;
552   }
553   if (failure instanceof Error) {
554     throw (Error) failure;
555   }
556   if (failure != null) {
557     throw new RuntimeException(failure);
558   }
559 }
560 
testAllAsList_singleFailure()561 public void testAllAsList_singleFailure() throws Exception {
562   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
563   testCase.setUp();
564   Throwable failure = null;
565   try {
566     testCase.testAllAsList_singleFailure();
567   } catch (Throwable t) {
568     failure = t;
569   }
570   try {
571     testCase.tearDown();
572   } catch (Throwable t) {
573     if (failure == null) {
574       failure = t;
575     }
576   }
577   if (failure instanceof Exception) {
578     throw (Exception) failure;
579   }
580   if (failure instanceof Error) {
581     throw (Error) failure;
582   }
583   if (failure != null) {
584     throw new RuntimeException(failure);
585   }
586 }
587 
testCancellingADelegatePropagates()588 public void testCancellingADelegatePropagates() throws Exception {
589   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
590   testCase.setUp();
591   Throwable failure = null;
592   try {
593     testCase.testCancellingADelegatePropagates();
594   } catch (Throwable t) {
595     failure = t;
596   }
597   try {
598     testCase.tearDown();
599   } catch (Throwable t) {
600     if (failure == null) {
601       failure = t;
602     }
603   }
604   if (failure instanceof Exception) {
605     throw (Exception) failure;
606   }
607   if (failure instanceof Error) {
608     throw (Error) failure;
609   }
610   if (failure != null) {
611     throw new RuntimeException(failure);
612   }
613 }
614 
testCancellingAllDelegatesIsNotQuadratic()615 public void testCancellingAllDelegatesIsNotQuadratic() throws Exception {
616   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
617   testCase.setUp();
618   Throwable failure = null;
619   try {
620     testCase.testCancellingAllDelegatesIsNotQuadratic();
621   } catch (Throwable t) {
622     failure = t;
623   }
624   try {
625     testCase.tearDown();
626   } catch (Throwable t) {
627     if (failure == null) {
628       failure = t;
629     }
630   }
631   if (failure instanceof Exception) {
632     throw (Exception) failure;
633   }
634   if (failure instanceof Error) {
635     throw (Error) failure;
636   }
637   if (failure != null) {
638     throw new RuntimeException(failure);
639   }
640 }
641 
testCatchingAsync_ErrorAfterCancellation()642 public void testCatchingAsync_ErrorAfterCancellation() throws Exception {
643   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
644   testCase.setUp();
645   Throwable failure = null;
646   try {
647     testCase.testCatchingAsync_ErrorAfterCancellation();
648   } catch (Throwable t) {
649     failure = t;
650   }
651   try {
652     testCase.tearDown();
653   } catch (Throwable t) {
654     if (failure == null) {
655       failure = t;
656     }
657   }
658   if (failure instanceof Exception) {
659     throw (Exception) failure;
660   }
661   if (failure instanceof Error) {
662     throw (Error) failure;
663   }
664   if (failure != null) {
665     throw new RuntimeException(failure);
666   }
667 }
668 
testCatchingAsync_ExceptionAfterCancellation()669 public void testCatchingAsync_ExceptionAfterCancellation() throws Exception {
670   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
671   testCase.setUp();
672   Throwable failure = null;
673   try {
674     testCase.testCatchingAsync_ExceptionAfterCancellation();
675   } catch (Throwable t) {
676     failure = t;
677   }
678   try {
679     testCase.tearDown();
680   } catch (Throwable t) {
681     if (failure == null) {
682       failure = t;
683     }
684   }
685   if (failure instanceof Exception) {
686     throw (Exception) failure;
687   }
688   if (failure instanceof Error) {
689     throw (Error) failure;
690   }
691   if (failure != null) {
692     throw new RuntimeException(failure);
693   }
694 }
695 
testCatchingAsync_Throwable()696 public void testCatchingAsync_Throwable() throws Exception {
697   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
698   testCase.setUp();
699   Throwable failure = null;
700   try {
701     testCase.testCatchingAsync_Throwable();
702   } catch (Throwable t) {
703     failure = t;
704   }
705   try {
706     testCase.tearDown();
707   } catch (Throwable t) {
708     if (failure == null) {
709       failure = t;
710     }
711   }
712   if (failure instanceof Exception) {
713     throw (Exception) failure;
714   }
715   if (failure instanceof Error) {
716     throw (Error) failure;
717   }
718   if (failure != null) {
719     throw new RuntimeException(failure);
720   }
721 }
722 
testCatchingAsync_fallbackGeneratesCheckedException()723 public void testCatchingAsync_fallbackGeneratesCheckedException() throws Exception {
724   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
725   testCase.setUp();
726   Throwable failure = null;
727   try {
728     testCase.testCatchingAsync_fallbackGeneratesCheckedException();
729   } catch (Throwable t) {
730     failure = t;
731   }
732   try {
733     testCase.tearDown();
734   } catch (Throwable t) {
735     if (failure == null) {
736       failure = t;
737     }
738   }
739   if (failure instanceof Exception) {
740     throw (Exception) failure;
741   }
742   if (failure instanceof Error) {
743     throw (Error) failure;
744   }
745   if (failure != null) {
746     throw new RuntimeException(failure);
747   }
748 }
749 
testCatchingAsync_fallbackGeneratesError()750 public void testCatchingAsync_fallbackGeneratesError() throws Exception {
751   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
752   testCase.setUp();
753   Throwable failure = null;
754   try {
755     testCase.testCatchingAsync_fallbackGeneratesError();
756   } catch (Throwable t) {
757     failure = t;
758   }
759   try {
760     testCase.tearDown();
761   } catch (Throwable t) {
762     if (failure == null) {
763       failure = t;
764     }
765   }
766   if (failure instanceof Exception) {
767     throw (Exception) failure;
768   }
769   if (failure instanceof Error) {
770     throw (Error) failure;
771   }
772   if (failure != null) {
773     throw new RuntimeException(failure);
774   }
775 }
776 
testCatchingAsync_fallbackGeneratesRuntimeException()777 public void testCatchingAsync_fallbackGeneratesRuntimeException() throws Exception {
778   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
779   testCase.setUp();
780   Throwable failure = null;
781   try {
782     testCase.testCatchingAsync_fallbackGeneratesRuntimeException();
783   } catch (Throwable t) {
784     failure = t;
785   }
786   try {
787     testCase.tearDown();
788   } catch (Throwable t) {
789     if (failure == null) {
790       failure = t;
791     }
792   }
793   if (failure instanceof Exception) {
794     throw (Exception) failure;
795   }
796   if (failure instanceof Error) {
797     throw (Error) failure;
798   }
799   if (failure != null) {
800     throw new RuntimeException(failure);
801   }
802 }
803 
testCatchingAsync_fallbackNotReady()804 public void testCatchingAsync_fallbackNotReady() throws Exception {
805   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
806   testCase.setUp();
807   Throwable failure = null;
808   try {
809     testCase.testCatchingAsync_fallbackNotReady();
810   } catch (Throwable t) {
811     failure = t;
812   }
813   try {
814     testCase.tearDown();
815   } catch (Throwable t) {
816     if (failure == null) {
817       failure = t;
818     }
819   }
820   if (failure instanceof Exception) {
821     throw (Exception) failure;
822   }
823   if (failure instanceof Error) {
824     throw (Error) failure;
825   }
826   if (failure != null) {
827     throw new RuntimeException(failure);
828   }
829 }
830 
testCatchingAsync_fallbackReturnsCheckedException()831 public void testCatchingAsync_fallbackReturnsCheckedException() throws Exception {
832   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
833   testCase.setUp();
834   Throwable failure = null;
835   try {
836     testCase.testCatchingAsync_fallbackReturnsCheckedException();
837   } catch (Throwable t) {
838     failure = t;
839   }
840   try {
841     testCase.tearDown();
842   } catch (Throwable t) {
843     if (failure == null) {
844       failure = t;
845     }
846   }
847   if (failure instanceof Exception) {
848     throw (Exception) failure;
849   }
850   if (failure instanceof Error) {
851     throw (Error) failure;
852   }
853   if (failure != null) {
854     throw new RuntimeException(failure);
855   }
856 }
857 
testCatchingAsync_fallbackReturnsRuntimeException()858 public void testCatchingAsync_fallbackReturnsRuntimeException() throws Exception {
859   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
860   testCase.setUp();
861   Throwable failure = null;
862   try {
863     testCase.testCatchingAsync_fallbackReturnsRuntimeException();
864   } catch (Throwable t) {
865     failure = t;
866   }
867   try {
868     testCase.tearDown();
869   } catch (Throwable t) {
870     if (failure == null) {
871       failure = t;
872     }
873   }
874   if (failure instanceof Exception) {
875     throw (Exception) failure;
876   }
877   if (failure instanceof Error) {
878     throw (Error) failure;
879   }
880   if (failure != null) {
881     throw new RuntimeException(failure);
882   }
883 }
884 
testCatchingAsync_futureToString()885 public void testCatchingAsync_futureToString() throws Exception {
886   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
887   testCase.setUp();
888   Throwable failure = null;
889   try {
890     testCase.testCatchingAsync_futureToString();
891   } catch (Throwable t) {
892     failure = t;
893   }
894   try {
895     testCase.tearDown();
896   } catch (Throwable t) {
897     if (failure == null) {
898       failure = t;
899     }
900   }
901   if (failure instanceof Exception) {
902     throw (Exception) failure;
903   }
904   if (failure instanceof Error) {
905     throw (Error) failure;
906   }
907   if (failure != null) {
908     throw new RuntimeException(failure);
909   }
910 }
911 
testCatchingAsync_getThrowsError()912 public void testCatchingAsync_getThrowsError() throws Exception {
913   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
914   testCase.setUp();
915   Throwable failure = null;
916   try {
917     testCase.testCatchingAsync_getThrowsError();
918   } catch (Throwable t) {
919     failure = t;
920   }
921   try {
922     testCase.tearDown();
923   } catch (Throwable t) {
924     if (failure == null) {
925       failure = t;
926     }
927   }
928   if (failure instanceof Exception) {
929     throw (Exception) failure;
930   }
931   if (failure instanceof Error) {
932     throw (Error) failure;
933   }
934   if (failure != null) {
935     throw new RuntimeException(failure);
936   }
937 }
938 
testCatchingAsync_getThrowsRuntimeException()939 public void testCatchingAsync_getThrowsRuntimeException() throws Exception {
940   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
941   testCase.setUp();
942   Throwable failure = null;
943   try {
944     testCase.testCatchingAsync_getThrowsRuntimeException();
945   } catch (Throwable t) {
946     failure = t;
947   }
948   try {
949     testCase.tearDown();
950   } catch (Throwable t) {
951     if (failure == null) {
952       failure = t;
953     }
954   }
955   if (failure instanceof Exception) {
956     throw (Exception) failure;
957   }
958   if (failure instanceof Error) {
959     throw (Error) failure;
960   }
961   if (failure != null) {
962     throw new RuntimeException(failure);
963   }
964 }
965 
testCatchingAsync_inputDoesNotRaiseException()966 public void testCatchingAsync_inputDoesNotRaiseException() throws Exception {
967   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
968   testCase.setUp();
969   Throwable failure = null;
970   try {
971     testCase.testCatchingAsync_inputDoesNotRaiseException();
972   } catch (Throwable t) {
973     failure = t;
974   }
975   try {
976     testCase.tearDown();
977   } catch (Throwable t) {
978     if (failure == null) {
979       failure = t;
980     }
981   }
982   if (failure instanceof Exception) {
983     throw (Exception) failure;
984   }
985   if (failure instanceof Error) {
986     throw (Error) failure;
987   }
988   if (failure != null) {
989     throw new RuntimeException(failure);
990   }
991 }
992 
testCatchingAsync_inputRaisesException()993 public void testCatchingAsync_inputRaisesException() throws Exception {
994   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
995   testCase.setUp();
996   Throwable failure = null;
997   try {
998     testCase.testCatchingAsync_inputRaisesException();
999   } catch (Throwable t) {
1000     failure = t;
1001   }
1002   try {
1003     testCase.tearDown();
1004   } catch (Throwable t) {
1005     if (failure == null) {
1006       failure = t;
1007     }
1008   }
1009   if (failure instanceof Exception) {
1010     throw (Exception) failure;
1011   }
1012   if (failure instanceof Error) {
1013     throw (Error) failure;
1014   }
1015   if (failure != null) {
1016     throw new RuntimeException(failure);
1017   }
1018 }
1019 
testCatchingAsync_listenerThrowsError()1020 public void testCatchingAsync_listenerThrowsError() throws Exception {
1021   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1022   testCase.setUp();
1023   Throwable failure = null;
1024   try {
1025     testCase.testCatchingAsync_listenerThrowsError();
1026   } catch (Throwable t) {
1027     failure = t;
1028   }
1029   try {
1030     testCase.tearDown();
1031   } catch (Throwable t) {
1032     if (failure == null) {
1033       failure = t;
1034     }
1035   }
1036   if (failure instanceof Exception) {
1037     throw (Exception) failure;
1038   }
1039   if (failure instanceof Error) {
1040     throw (Error) failure;
1041   }
1042   if (failure != null) {
1043     throw new RuntimeException(failure);
1044   }
1045 }
1046 
testCatchingAsync_nullInsteadOfFuture()1047 public void testCatchingAsync_nullInsteadOfFuture() throws Exception {
1048   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1049   testCase.setUp();
1050   Throwable failure = null;
1051   try {
1052     testCase.testCatchingAsync_nullInsteadOfFuture();
1053   } catch (Throwable t) {
1054     failure = t;
1055   }
1056   try {
1057     testCase.tearDown();
1058   } catch (Throwable t) {
1059     if (failure == null) {
1060       failure = t;
1061     }
1062   }
1063   if (failure instanceof Exception) {
1064     throw (Exception) failure;
1065   }
1066   if (failure instanceof Error) {
1067     throw (Error) failure;
1068   }
1069   if (failure != null) {
1070     throw new RuntimeException(failure);
1071   }
1072 }
1073 
testCatchingAsync_rejectionPropagatesToOutput()1074 public void testCatchingAsync_rejectionPropagatesToOutput() throws Exception {
1075   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1076   testCase.setUp();
1077   Throwable failure = null;
1078   try {
1079     testCase.testCatchingAsync_rejectionPropagatesToOutput();
1080   } catch (Throwable t) {
1081     failure = t;
1082   }
1083   try {
1084     testCase.tearDown();
1085   } catch (Throwable t) {
1086     if (failure == null) {
1087       failure = t;
1088     }
1089   }
1090   if (failure instanceof Exception) {
1091     throw (Exception) failure;
1092   }
1093   if (failure instanceof Error) {
1094     throw (Error) failure;
1095   }
1096   if (failure != null) {
1097     throw new RuntimeException(failure);
1098   }
1099 }
1100 
testCatchingAsync_resultCancelledBeforeFallback()1101 public void testCatchingAsync_resultCancelledBeforeFallback() throws Exception {
1102   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1103   testCase.setUp();
1104   Throwable failure = null;
1105   try {
1106     testCase.testCatchingAsync_resultCancelledBeforeFallback();
1107   } catch (Throwable t) {
1108     failure = t;
1109   }
1110   try {
1111     testCase.tearDown();
1112   } catch (Throwable t) {
1113     if (failure == null) {
1114       failure = t;
1115     }
1116   }
1117   if (failure instanceof Exception) {
1118     throw (Exception) failure;
1119   }
1120   if (failure instanceof Error) {
1121     throw (Error) failure;
1122   }
1123   if (failure != null) {
1124     throw new RuntimeException(failure);
1125   }
1126 }
1127 
testCatchingAsync_resultInterruptedBeforeFallback()1128 public void testCatchingAsync_resultInterruptedBeforeFallback() throws Exception {
1129   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1130   testCase.setUp();
1131   Throwable failure = null;
1132   try {
1133     testCase.testCatchingAsync_resultInterruptedBeforeFallback();
1134   } catch (Throwable t) {
1135     failure = t;
1136   }
1137   try {
1138     testCase.tearDown();
1139   } catch (Throwable t) {
1140     if (failure == null) {
1141       failure = t;
1142     }
1143   }
1144   if (failure instanceof Exception) {
1145     throw (Exception) failure;
1146   }
1147   if (failure instanceof Error) {
1148     throw (Error) failure;
1149   }
1150   if (failure != null) {
1151     throw new RuntimeException(failure);
1152   }
1153 }
1154 
testCatching_ErrorAfterCancellation()1155 public void testCatching_ErrorAfterCancellation() throws Exception {
1156   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1157   testCase.setUp();
1158   Throwable failure = null;
1159   try {
1160     testCase.testCatching_ErrorAfterCancellation();
1161   } catch (Throwable t) {
1162     failure = t;
1163   }
1164   try {
1165     testCase.tearDown();
1166   } catch (Throwable t) {
1167     if (failure == null) {
1168       failure = t;
1169     }
1170   }
1171   if (failure instanceof Exception) {
1172     throw (Exception) failure;
1173   }
1174   if (failure instanceof Error) {
1175     throw (Error) failure;
1176   }
1177   if (failure != null) {
1178     throw new RuntimeException(failure);
1179   }
1180 }
1181 
testCatching_ExceptionAfterCancellation()1182 public void testCatching_ExceptionAfterCancellation() throws Exception {
1183   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1184   testCase.setUp();
1185   Throwable failure = null;
1186   try {
1187     testCase.testCatching_ExceptionAfterCancellation();
1188   } catch (Throwable t) {
1189     failure = t;
1190   }
1191   try {
1192     testCase.tearDown();
1193   } catch (Throwable t) {
1194     if (failure == null) {
1195       failure = t;
1196     }
1197   }
1198   if (failure instanceof Exception) {
1199     throw (Exception) failure;
1200   }
1201   if (failure instanceof Error) {
1202     throw (Error) failure;
1203   }
1204   if (failure != null) {
1205     throw new RuntimeException(failure);
1206   }
1207 }
1208 
testCatching_Throwable()1209 public void testCatching_Throwable() throws Exception {
1210   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1211   testCase.setUp();
1212   Throwable failure = null;
1213   try {
1214     testCase.testCatching_Throwable();
1215   } catch (Throwable t) {
1216     failure = t;
1217   }
1218   try {
1219     testCase.tearDown();
1220   } catch (Throwable t) {
1221     if (failure == null) {
1222       failure = t;
1223     }
1224   }
1225   if (failure instanceof Exception) {
1226     throw (Exception) failure;
1227   }
1228   if (failure instanceof Error) {
1229     throw (Error) failure;
1230   }
1231   if (failure != null) {
1232     throw new RuntimeException(failure);
1233   }
1234 }
1235 
testCatching_fallbackGeneratesError()1236 public void testCatching_fallbackGeneratesError() throws Exception {
1237   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1238   testCase.setUp();
1239   Throwable failure = null;
1240   try {
1241     testCase.testCatching_fallbackGeneratesError();
1242   } catch (Throwable t) {
1243     failure = t;
1244   }
1245   try {
1246     testCase.tearDown();
1247   } catch (Throwable t) {
1248     if (failure == null) {
1249       failure = t;
1250     }
1251   }
1252   if (failure instanceof Exception) {
1253     throw (Exception) failure;
1254   }
1255   if (failure instanceof Error) {
1256     throw (Error) failure;
1257   }
1258   if (failure != null) {
1259     throw new RuntimeException(failure);
1260   }
1261 }
1262 
testCatching_fallbackGeneratesRuntimeException()1263 public void testCatching_fallbackGeneratesRuntimeException() throws Exception {
1264   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1265   testCase.setUp();
1266   Throwable failure = null;
1267   try {
1268     testCase.testCatching_fallbackGeneratesRuntimeException();
1269   } catch (Throwable t) {
1270     failure = t;
1271   }
1272   try {
1273     testCase.tearDown();
1274   } catch (Throwable t) {
1275     if (failure == null) {
1276       failure = t;
1277     }
1278   }
1279   if (failure instanceof Exception) {
1280     throw (Exception) failure;
1281   }
1282   if (failure instanceof Error) {
1283     throw (Error) failure;
1284   }
1285   if (failure != null) {
1286     throw new RuntimeException(failure);
1287   }
1288 }
1289 
testCatching_getThrowsError()1290 public void testCatching_getThrowsError() throws Exception {
1291   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1292   testCase.setUp();
1293   Throwable failure = null;
1294   try {
1295     testCase.testCatching_getThrowsError();
1296   } catch (Throwable t) {
1297     failure = t;
1298   }
1299   try {
1300     testCase.tearDown();
1301   } catch (Throwable t) {
1302     if (failure == null) {
1303       failure = t;
1304     }
1305   }
1306   if (failure instanceof Exception) {
1307     throw (Exception) failure;
1308   }
1309   if (failure instanceof Error) {
1310     throw (Error) failure;
1311   }
1312   if (failure != null) {
1313     throw new RuntimeException(failure);
1314   }
1315 }
1316 
testCatching_getThrowsRuntimeException()1317 public void testCatching_getThrowsRuntimeException() throws Exception {
1318   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1319   testCase.setUp();
1320   Throwable failure = null;
1321   try {
1322     testCase.testCatching_getThrowsRuntimeException();
1323   } catch (Throwable t) {
1324     failure = t;
1325   }
1326   try {
1327     testCase.tearDown();
1328   } catch (Throwable t) {
1329     if (failure == null) {
1330       failure = t;
1331     }
1332   }
1333   if (failure instanceof Exception) {
1334     throw (Exception) failure;
1335   }
1336   if (failure instanceof Error) {
1337     throw (Error) failure;
1338   }
1339   if (failure != null) {
1340     throw new RuntimeException(failure);
1341   }
1342 }
1343 
testCatching_inputDoesNotRaiseException()1344 public void testCatching_inputDoesNotRaiseException() throws Exception {
1345   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1346   testCase.setUp();
1347   Throwable failure = null;
1348   try {
1349     testCase.testCatching_inputDoesNotRaiseException();
1350   } catch (Throwable t) {
1351     failure = t;
1352   }
1353   try {
1354     testCase.tearDown();
1355   } catch (Throwable t) {
1356     if (failure == null) {
1357       failure = t;
1358     }
1359   }
1360   if (failure instanceof Exception) {
1361     throw (Exception) failure;
1362   }
1363   if (failure instanceof Error) {
1364     throw (Error) failure;
1365   }
1366   if (failure != null) {
1367     throw new RuntimeException(failure);
1368   }
1369 }
1370 
testCatching_inputRaisesException()1371 public void testCatching_inputRaisesException() throws Exception {
1372   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1373   testCase.setUp();
1374   Throwable failure = null;
1375   try {
1376     testCase.testCatching_inputRaisesException();
1377   } catch (Throwable t) {
1378     failure = t;
1379   }
1380   try {
1381     testCase.tearDown();
1382   } catch (Throwable t) {
1383     if (failure == null) {
1384       failure = t;
1385     }
1386   }
1387   if (failure instanceof Exception) {
1388     throw (Exception) failure;
1389   }
1390   if (failure instanceof Error) {
1391     throw (Error) failure;
1392   }
1393   if (failure != null) {
1394     throw new RuntimeException(failure);
1395   }
1396 }
1397 
testCatching_listenerThrowsError()1398 public void testCatching_listenerThrowsError() throws Exception {
1399   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1400   testCase.setUp();
1401   Throwable failure = null;
1402   try {
1403     testCase.testCatching_listenerThrowsError();
1404   } catch (Throwable t) {
1405     failure = t;
1406   }
1407   try {
1408     testCase.tearDown();
1409   } catch (Throwable t) {
1410     if (failure == null) {
1411       failure = t;
1412     }
1413   }
1414   if (failure instanceof Exception) {
1415     throw (Exception) failure;
1416   }
1417   if (failure instanceof Error) {
1418     throw (Error) failure;
1419   }
1420   if (failure != null) {
1421     throw new RuntimeException(failure);
1422   }
1423 }
1424 
testCatching_rejectionPropagatesToOutput()1425 public void testCatching_rejectionPropagatesToOutput() throws Exception {
1426   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1427   testCase.setUp();
1428   Throwable failure = null;
1429   try {
1430     testCase.testCatching_rejectionPropagatesToOutput();
1431   } catch (Throwable t) {
1432     failure = t;
1433   }
1434   try {
1435     testCase.tearDown();
1436   } catch (Throwable t) {
1437     if (failure == null) {
1438       failure = t;
1439     }
1440   }
1441   if (failure instanceof Exception) {
1442     throw (Exception) failure;
1443   }
1444   if (failure instanceof Error) {
1445     throw (Error) failure;
1446   }
1447   if (failure != null) {
1448     throw new RuntimeException(failure);
1449   }
1450 }
1451 
testCatching_resultCancelledBeforeFallback()1452 public void testCatching_resultCancelledBeforeFallback() throws Exception {
1453   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1454   testCase.setUp();
1455   Throwable failure = null;
1456   try {
1457     testCase.testCatching_resultCancelledBeforeFallback();
1458   } catch (Throwable t) {
1459     failure = t;
1460   }
1461   try {
1462     testCase.tearDown();
1463   } catch (Throwable t) {
1464     if (failure == null) {
1465       failure = t;
1466     }
1467   }
1468   if (failure instanceof Exception) {
1469     throw (Exception) failure;
1470   }
1471   if (failure instanceof Error) {
1472     throw (Error) failure;
1473   }
1474   if (failure != null) {
1475     throw new RuntimeException(failure);
1476   }
1477 }
1478 
testCatching_resultInterruptedBeforeFallback()1479 public void testCatching_resultInterruptedBeforeFallback() throws Exception {
1480   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1481   testCase.setUp();
1482   Throwable failure = null;
1483   try {
1484     testCase.testCatching_resultInterruptedBeforeFallback();
1485   } catch (Throwable t) {
1486     failure = t;
1487   }
1488   try {
1489     testCase.tearDown();
1490   } catch (Throwable t) {
1491     if (failure == null) {
1492       failure = t;
1493     }
1494   }
1495   if (failure instanceof Exception) {
1496     throw (Exception) failure;
1497   }
1498   if (failure instanceof Error) {
1499     throw (Error) failure;
1500   }
1501   if (failure != null) {
1502     throw new RuntimeException(failure);
1503   }
1504 }
1505 
testCompletionOrder()1506 public void testCompletionOrder() throws Exception {
1507   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1508   testCase.setUp();
1509   Throwable failure = null;
1510   try {
1511     testCase.testCompletionOrder();
1512   } catch (Throwable t) {
1513     failure = t;
1514   }
1515   try {
1516     testCase.tearDown();
1517   } catch (Throwable t) {
1518     if (failure == null) {
1519       failure = t;
1520     }
1521   }
1522   if (failure instanceof Exception) {
1523     throw (Exception) failure;
1524   }
1525   if (failure instanceof Error) {
1526     throw (Error) failure;
1527   }
1528   if (failure != null) {
1529     throw new RuntimeException(failure);
1530   }
1531 }
1532 
testCompletionOrderExceptionThrown()1533 public void testCompletionOrderExceptionThrown() throws Exception {
1534   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1535   testCase.setUp();
1536   Throwable failure = null;
1537   try {
1538     testCase.testCompletionOrderExceptionThrown();
1539   } catch (Throwable t) {
1540     failure = t;
1541   }
1542   try {
1543     testCase.tearDown();
1544   } catch (Throwable t) {
1545     if (failure == null) {
1546       failure = t;
1547     }
1548   }
1549   if (failure instanceof Exception) {
1550     throw (Exception) failure;
1551   }
1552   if (failure instanceof Error) {
1553     throw (Error) failure;
1554   }
1555   if (failure != null) {
1556     throw new RuntimeException(failure);
1557   }
1558 }
1559 
testCompletionOrderFutureCancelled()1560 public void testCompletionOrderFutureCancelled() throws Exception {
1561   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1562   testCase.setUp();
1563   Throwable failure = null;
1564   try {
1565     testCase.testCompletionOrderFutureCancelled();
1566   } catch (Throwable t) {
1567     failure = t;
1568   }
1569   try {
1570     testCase.tearDown();
1571   } catch (Throwable t) {
1572     if (failure == null) {
1573       failure = t;
1574     }
1575   }
1576   if (failure instanceof Exception) {
1577     throw (Exception) failure;
1578   }
1579   if (failure instanceof Error) {
1580     throw (Error) failure;
1581   }
1582   if (failure != null) {
1583     throw new RuntimeException(failure);
1584   }
1585 }
1586 
testCompletionOrderFutureInterruption()1587 public void testCompletionOrderFutureInterruption() throws Exception {
1588   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1589   testCase.setUp();
1590   Throwable failure = null;
1591   try {
1592     testCase.testCompletionOrderFutureInterruption();
1593   } catch (Throwable t) {
1594     failure = t;
1595   }
1596   try {
1597     testCase.tearDown();
1598   } catch (Throwable t) {
1599     if (failure == null) {
1600       failure = t;
1601     }
1602   }
1603   if (failure instanceof Exception) {
1604     throw (Exception) failure;
1605   }
1606   if (failure instanceof Error) {
1607     throw (Error) failure;
1608   }
1609   if (failure != null) {
1610     throw new RuntimeException(failure);
1611   }
1612 }
1613 
testCompletionOrderMixedBagOTypes()1614 public void testCompletionOrderMixedBagOTypes() throws Exception {
1615   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1616   testCase.setUp();
1617   Throwable failure = null;
1618   try {
1619     testCase.testCompletionOrderMixedBagOTypes();
1620   } catch (Throwable t) {
1621     failure = t;
1622   }
1623   try {
1624     testCase.tearDown();
1625   } catch (Throwable t) {
1626     if (failure == null) {
1627       failure = t;
1628     }
1629   }
1630   if (failure instanceof Exception) {
1631     throw (Exception) failure;
1632   }
1633   if (failure instanceof Error) {
1634     throw (Error) failure;
1635   }
1636   if (failure != null) {
1637     throw new RuntimeException(failure);
1638   }
1639 }
1640 
testImmediateCancelledFutureBasic()1641 public void testImmediateCancelledFutureBasic() throws Exception {
1642   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1643   testCase.setUp();
1644   Throwable failure = null;
1645   try {
1646     testCase.testImmediateCancelledFutureBasic();
1647   } catch (Throwable t) {
1648     failure = t;
1649   }
1650   try {
1651     testCase.tearDown();
1652   } catch (Throwable t) {
1653     if (failure == null) {
1654       failure = t;
1655     }
1656   }
1657   if (failure instanceof Exception) {
1658     throw (Exception) failure;
1659   }
1660   if (failure instanceof Error) {
1661     throw (Error) failure;
1662   }
1663   if (failure != null) {
1664     throw new RuntimeException(failure);
1665   }
1666 }
1667 
testImmediateFailedFuture()1668 public void testImmediateFailedFuture() throws Exception {
1669   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1670   testCase.setUp();
1671   Throwable failure = null;
1672   try {
1673     testCase.testImmediateFailedFuture();
1674   } catch (Throwable t) {
1675     failure = t;
1676   }
1677   try {
1678     testCase.tearDown();
1679   } catch (Throwable t) {
1680     if (failure == null) {
1681       failure = t;
1682     }
1683   }
1684   if (failure instanceof Exception) {
1685     throw (Exception) failure;
1686   }
1687   if (failure instanceof Error) {
1688     throw (Error) failure;
1689   }
1690   if (failure != null) {
1691     throw new RuntimeException(failure);
1692   }
1693 }
1694 
testImmediateFailedFuture_cancellationException()1695 public void testImmediateFailedFuture_cancellationException() throws Exception {
1696   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1697   testCase.setUp();
1698   Throwable failure = null;
1699   try {
1700     testCase.testImmediateFailedFuture_cancellationException();
1701   } catch (Throwable t) {
1702     failure = t;
1703   }
1704   try {
1705     testCase.tearDown();
1706   } catch (Throwable t) {
1707     if (failure == null) {
1708       failure = t;
1709     }
1710   }
1711   if (failure instanceof Exception) {
1712     throw (Exception) failure;
1713   }
1714   if (failure instanceof Error) {
1715     throw (Error) failure;
1716   }
1717   if (failure != null) {
1718     throw new RuntimeException(failure);
1719   }
1720 }
1721 
testImmediateFuture()1722 public void testImmediateFuture() throws Exception {
1723   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1724   testCase.setUp();
1725   Throwable failure = null;
1726   try {
1727     testCase.testImmediateFuture();
1728   } catch (Throwable t) {
1729     failure = t;
1730   }
1731   try {
1732     testCase.tearDown();
1733   } catch (Throwable t) {
1734     if (failure == null) {
1735       failure = t;
1736     }
1737   }
1738   if (failure instanceof Exception) {
1739     throw (Exception) failure;
1740   }
1741   if (failure instanceof Error) {
1742     throw (Error) failure;
1743   }
1744   if (failure != null) {
1745     throw new RuntimeException(failure);
1746   }
1747 }
1748 
testNonCancellationPropagating_delegateCancelled()1749 public void testNonCancellationPropagating_delegateCancelled() throws Exception {
1750   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1751   testCase.setUp();
1752   Throwable failure = null;
1753   try {
1754     testCase.testNonCancellationPropagating_delegateCancelled();
1755   } catch (Throwable t) {
1756     failure = t;
1757   }
1758   try {
1759     testCase.tearDown();
1760   } catch (Throwable t) {
1761     if (failure == null) {
1762       failure = t;
1763     }
1764   }
1765   if (failure instanceof Exception) {
1766     throw (Exception) failure;
1767   }
1768   if (failure instanceof Error) {
1769     throw (Error) failure;
1770   }
1771   if (failure != null) {
1772     throw new RuntimeException(failure);
1773   }
1774 }
1775 
testNonCancellationPropagating_doesNotPropagate()1776 public void testNonCancellationPropagating_doesNotPropagate() throws Exception {
1777   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1778   testCase.setUp();
1779   Throwable failure = null;
1780   try {
1781     testCase.testNonCancellationPropagating_doesNotPropagate();
1782   } catch (Throwable t) {
1783     failure = t;
1784   }
1785   try {
1786     testCase.tearDown();
1787   } catch (Throwable t) {
1788     if (failure == null) {
1789       failure = t;
1790     }
1791   }
1792   if (failure instanceof Exception) {
1793     throw (Exception) failure;
1794   }
1795   if (failure instanceof Error) {
1796     throw (Error) failure;
1797   }
1798   if (failure != null) {
1799     throw new RuntimeException(failure);
1800   }
1801 }
1802 
testNonCancellationPropagating_failure()1803 public void testNonCancellationPropagating_failure() throws Exception {
1804   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1805   testCase.setUp();
1806   Throwable failure = null;
1807   try {
1808     testCase.testNonCancellationPropagating_failure();
1809   } catch (Throwable t) {
1810     failure = t;
1811   }
1812   try {
1813     testCase.tearDown();
1814   } catch (Throwable t) {
1815     if (failure == null) {
1816       failure = t;
1817     }
1818   }
1819   if (failure instanceof Exception) {
1820     throw (Exception) failure;
1821   }
1822   if (failure instanceof Error) {
1823     throw (Error) failure;
1824   }
1825   if (failure != null) {
1826     throw new RuntimeException(failure);
1827   }
1828 }
1829 
testNonCancellationPropagating_successful()1830 public void testNonCancellationPropagating_successful() throws Exception {
1831   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1832   testCase.setUp();
1833   Throwable failure = null;
1834   try {
1835     testCase.testNonCancellationPropagating_successful();
1836   } catch (Throwable t) {
1837     failure = t;
1838   }
1839   try {
1840     testCase.tearDown();
1841   } catch (Throwable t) {
1842     if (failure == null) {
1843       failure = t;
1844     }
1845   }
1846   if (failure instanceof Exception) {
1847     throw (Exception) failure;
1848   }
1849   if (failure instanceof Error) {
1850     throw (Error) failure;
1851   }
1852   if (failure != null) {
1853     throw new RuntimeException(failure);
1854   }
1855 }
1856 
testSubmitAsync_asyncCallable_error()1857 public void testSubmitAsync_asyncCallable_error() throws Exception {
1858   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1859   testCase.setUp();
1860   Throwable failure = null;
1861   try {
1862     testCase.testSubmitAsync_asyncCallable_error();
1863   } catch (Throwable t) {
1864     failure = t;
1865   }
1866   try {
1867     testCase.tearDown();
1868   } catch (Throwable t) {
1869     if (failure == null) {
1870       failure = t;
1871     }
1872   }
1873   if (failure instanceof Exception) {
1874     throw (Exception) failure;
1875   }
1876   if (failure instanceof Error) {
1877     throw (Error) failure;
1878   }
1879   if (failure != null) {
1880     throw new RuntimeException(failure);
1881   }
1882 }
1883 
testSubmitAsync_asyncCallable_nullInsteadOfFuture()1884 public void testSubmitAsync_asyncCallable_nullInsteadOfFuture() throws Exception {
1885   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1886   testCase.setUp();
1887   Throwable failure = null;
1888   try {
1889     testCase.testSubmitAsync_asyncCallable_nullInsteadOfFuture();
1890   } catch (Throwable t) {
1891     failure = t;
1892   }
1893   try {
1894     testCase.tearDown();
1895   } catch (Throwable t) {
1896     if (failure == null) {
1897       failure = t;
1898     }
1899   }
1900   if (failure instanceof Exception) {
1901     throw (Exception) failure;
1902   }
1903   if (failure instanceof Error) {
1904     throw (Error) failure;
1905   }
1906   if (failure != null) {
1907     throw new RuntimeException(failure);
1908   }
1909 }
1910 
testSuccessfulAsList()1911 public void testSuccessfulAsList() throws Exception {
1912   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1913   testCase.setUp();
1914   Throwable failure = null;
1915   try {
1916     testCase.testSuccessfulAsList();
1917   } catch (Throwable t) {
1918     failure = t;
1919   }
1920   try {
1921     testCase.tearDown();
1922   } catch (Throwable t) {
1923     if (failure == null) {
1924       failure = t;
1925     }
1926   }
1927   if (failure instanceof Exception) {
1928     throw (Exception) failure;
1929   }
1930   if (failure instanceof Error) {
1931     throw (Error) failure;
1932   }
1933   if (failure != null) {
1934     throw new RuntimeException(failure);
1935   }
1936 }
1937 
testSuccessfulAsList_cancelled()1938 public void testSuccessfulAsList_cancelled() throws Exception {
1939   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1940   testCase.setUp();
1941   Throwable failure = null;
1942   try {
1943     testCase.testSuccessfulAsList_cancelled();
1944   } catch (Throwable t) {
1945     failure = t;
1946   }
1947   try {
1948     testCase.tearDown();
1949   } catch (Throwable t) {
1950     if (failure == null) {
1951       failure = t;
1952     }
1953   }
1954   if (failure instanceof Exception) {
1955     throw (Exception) failure;
1956   }
1957   if (failure instanceof Error) {
1958     throw (Error) failure;
1959   }
1960   if (failure != null) {
1961     throw new RuntimeException(failure);
1962   }
1963 }
1964 
testSuccessfulAsList_emptyArray()1965 public void testSuccessfulAsList_emptyArray() throws Exception {
1966   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1967   testCase.setUp();
1968   Throwable failure = null;
1969   try {
1970     testCase.testSuccessfulAsList_emptyArray();
1971   } catch (Throwable t) {
1972     failure = t;
1973   }
1974   try {
1975     testCase.tearDown();
1976   } catch (Throwable t) {
1977     if (failure == null) {
1978       failure = t;
1979     }
1980   }
1981   if (failure instanceof Exception) {
1982     throw (Exception) failure;
1983   }
1984   if (failure instanceof Error) {
1985     throw (Error) failure;
1986   }
1987   if (failure != null) {
1988     throw new RuntimeException(failure);
1989   }
1990 }
1991 
testSuccessfulAsList_emptyList()1992 public void testSuccessfulAsList_emptyList() throws Exception {
1993   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
1994   testCase.setUp();
1995   Throwable failure = null;
1996   try {
1997     testCase.testSuccessfulAsList_emptyList();
1998   } catch (Throwable t) {
1999     failure = t;
2000   }
2001   try {
2002     testCase.tearDown();
2003   } catch (Throwable t) {
2004     if (failure == null) {
2005       failure = t;
2006     }
2007   }
2008   if (failure instanceof Exception) {
2009     throw (Exception) failure;
2010   }
2011   if (failure instanceof Error) {
2012     throw (Error) failure;
2013   }
2014   if (failure != null) {
2015     throw new RuntimeException(failure);
2016   }
2017 }
2018 
testSuccessfulAsList_logging_error()2019 public void testSuccessfulAsList_logging_error() throws Exception {
2020   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2021   testCase.setUp();
2022   Throwable failure = null;
2023   try {
2024     testCase.testSuccessfulAsList_logging_error();
2025   } catch (Throwable t) {
2026     failure = t;
2027   }
2028   try {
2029     testCase.tearDown();
2030   } catch (Throwable t) {
2031     if (failure == null) {
2032       failure = t;
2033     }
2034   }
2035   if (failure instanceof Exception) {
2036     throw (Exception) failure;
2037   }
2038   if (failure instanceof Error) {
2039     throw (Error) failure;
2040   }
2041   if (failure != null) {
2042     throw new RuntimeException(failure);
2043   }
2044 }
2045 
testSuccessfulAsList_logging_exception()2046 public void testSuccessfulAsList_logging_exception() throws Exception {
2047   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2048   testCase.setUp();
2049   Throwable failure = null;
2050   try {
2051     testCase.testSuccessfulAsList_logging_exception();
2052   } catch (Throwable t) {
2053     failure = t;
2054   }
2055   try {
2056     testCase.tearDown();
2057   } catch (Throwable t) {
2058     if (failure == null) {
2059       failure = t;
2060     }
2061   }
2062   if (failure instanceof Exception) {
2063     throw (Exception) failure;
2064   }
2065   if (failure instanceof Error) {
2066     throw (Error) failure;
2067   }
2068   if (failure != null) {
2069     throw new RuntimeException(failure);
2070   }
2071 }
2072 
testSuccessfulAsList_mixed()2073 public void testSuccessfulAsList_mixed() throws Exception {
2074   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2075   testCase.setUp();
2076   Throwable failure = null;
2077   try {
2078     testCase.testSuccessfulAsList_mixed();
2079   } catch (Throwable t) {
2080     failure = t;
2081   }
2082   try {
2083     testCase.tearDown();
2084   } catch (Throwable t) {
2085     if (failure == null) {
2086       failure = t;
2087     }
2088   }
2089   if (failure instanceof Exception) {
2090     throw (Exception) failure;
2091   }
2092   if (failure instanceof Error) {
2093     throw (Error) failure;
2094   }
2095   if (failure != null) {
2096     throw new RuntimeException(failure);
2097   }
2098 }
2099 
testSuccessfulAsList_partialFailure()2100 public void testSuccessfulAsList_partialFailure() throws Exception {
2101   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2102   testCase.setUp();
2103   Throwable failure = null;
2104   try {
2105     testCase.testSuccessfulAsList_partialFailure();
2106   } catch (Throwable t) {
2107     failure = t;
2108   }
2109   try {
2110     testCase.tearDown();
2111   } catch (Throwable t) {
2112     if (failure == null) {
2113       failure = t;
2114     }
2115   }
2116   if (failure instanceof Exception) {
2117     throw (Exception) failure;
2118   }
2119   if (failure instanceof Error) {
2120     throw (Error) failure;
2121   }
2122   if (failure != null) {
2123     throw new RuntimeException(failure);
2124   }
2125 }
2126 
testSuccessfulAsList_resultCancelled()2127 public void testSuccessfulAsList_resultCancelled() throws Exception {
2128   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2129   testCase.setUp();
2130   Throwable failure = null;
2131   try {
2132     testCase.testSuccessfulAsList_resultCancelled();
2133   } catch (Throwable t) {
2134     failure = t;
2135   }
2136   try {
2137     testCase.tearDown();
2138   } catch (Throwable t) {
2139     if (failure == null) {
2140       failure = t;
2141     }
2142   }
2143   if (failure instanceof Exception) {
2144     throw (Exception) failure;
2145   }
2146   if (failure instanceof Error) {
2147     throw (Error) failure;
2148   }
2149   if (failure != null) {
2150     throw new RuntimeException(failure);
2151   }
2152 }
2153 
testSuccessfulAsList_resultCancelledRacingInputDone()2154 public void testSuccessfulAsList_resultCancelledRacingInputDone() throws Exception {
2155   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2156   testCase.setUp();
2157   Throwable failure = null;
2158   try {
2159     testCase.testSuccessfulAsList_resultCancelledRacingInputDone();
2160   } catch (Throwable t) {
2161     failure = t;
2162   }
2163   try {
2164     testCase.tearDown();
2165   } catch (Throwable t) {
2166     if (failure == null) {
2167       failure = t;
2168     }
2169   }
2170   if (failure instanceof Exception) {
2171     throw (Exception) failure;
2172   }
2173   if (failure instanceof Error) {
2174     throw (Error) failure;
2175   }
2176   if (failure != null) {
2177     throw new RuntimeException(failure);
2178   }
2179 }
2180 
testSuccessfulAsList_resultInterrupted()2181 public void testSuccessfulAsList_resultInterrupted() throws Exception {
2182   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2183   testCase.setUp();
2184   Throwable failure = null;
2185   try {
2186     testCase.testSuccessfulAsList_resultInterrupted();
2187   } catch (Throwable t) {
2188     failure = t;
2189   }
2190   try {
2191     testCase.tearDown();
2192   } catch (Throwable t) {
2193     if (failure == null) {
2194       failure = t;
2195     }
2196   }
2197   if (failure instanceof Exception) {
2198     throw (Exception) failure;
2199   }
2200   if (failure instanceof Error) {
2201     throw (Error) failure;
2202   }
2203   if (failure != null) {
2204     throw new RuntimeException(failure);
2205   }
2206 }
2207 
testSuccessfulAsList_totalFailure()2208 public void testSuccessfulAsList_totalFailure() throws Exception {
2209   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2210   testCase.setUp();
2211   Throwable failure = null;
2212   try {
2213     testCase.testSuccessfulAsList_totalFailure();
2214   } catch (Throwable t) {
2215     failure = t;
2216   }
2217   try {
2218     testCase.tearDown();
2219   } catch (Throwable t) {
2220     if (failure == null) {
2221       failure = t;
2222     }
2223   }
2224   if (failure instanceof Exception) {
2225     throw (Exception) failure;
2226   }
2227   if (failure instanceof Error) {
2228     throw (Error) failure;
2229   }
2230   if (failure != null) {
2231     throw new RuntimeException(failure);
2232   }
2233 }
2234 
testTransformAsync_ErrorAfterCancellation()2235 public void testTransformAsync_ErrorAfterCancellation() throws Exception {
2236   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2237   testCase.setUp();
2238   Throwable failure = null;
2239   try {
2240     testCase.testTransformAsync_ErrorAfterCancellation();
2241   } catch (Throwable t) {
2242     failure = t;
2243   }
2244   try {
2245     testCase.tearDown();
2246   } catch (Throwable t) {
2247     if (failure == null) {
2248       failure = t;
2249     }
2250   }
2251   if (failure instanceof Exception) {
2252     throw (Exception) failure;
2253   }
2254   if (failure instanceof Error) {
2255     throw (Error) failure;
2256   }
2257   if (failure != null) {
2258     throw new RuntimeException(failure);
2259   }
2260 }
2261 
testTransformAsync_ExceptionAfterCancellation()2262 public void testTransformAsync_ExceptionAfterCancellation() throws Exception {
2263   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2264   testCase.setUp();
2265   Throwable failure = null;
2266   try {
2267     testCase.testTransformAsync_ExceptionAfterCancellation();
2268   } catch (Throwable t) {
2269     failure = t;
2270   }
2271   try {
2272     testCase.tearDown();
2273   } catch (Throwable t) {
2274     if (failure == null) {
2275       failure = t;
2276     }
2277   }
2278   if (failure instanceof Exception) {
2279     throw (Exception) failure;
2280   }
2281   if (failure instanceof Error) {
2282     throw (Error) failure;
2283   }
2284   if (failure != null) {
2285     throw new RuntimeException(failure);
2286   }
2287 }
2288 
testTransformAsync_asyncFunction_error()2289 public void testTransformAsync_asyncFunction_error() throws Exception {
2290   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2291   testCase.setUp();
2292   Throwable failure = null;
2293   try {
2294     testCase.testTransformAsync_asyncFunction_error();
2295   } catch (Throwable t) {
2296     failure = t;
2297   }
2298   try {
2299     testCase.tearDown();
2300   } catch (Throwable t) {
2301     if (failure == null) {
2302       failure = t;
2303     }
2304   }
2305   if (failure instanceof Exception) {
2306     throw (Exception) failure;
2307   }
2308   if (failure instanceof Error) {
2309     throw (Error) failure;
2310   }
2311   if (failure != null) {
2312     throw new RuntimeException(failure);
2313   }
2314 }
2315 
testTransformAsync_asyncFunction_nullInsteadOfFuture()2316 public void testTransformAsync_asyncFunction_nullInsteadOfFuture() throws Exception {
2317   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2318   testCase.setUp();
2319   Throwable failure = null;
2320   try {
2321     testCase.testTransformAsync_asyncFunction_nullInsteadOfFuture();
2322   } catch (Throwable t) {
2323     failure = t;
2324   }
2325   try {
2326     testCase.tearDown();
2327   } catch (Throwable t) {
2328     if (failure == null) {
2329       failure = t;
2330     }
2331   }
2332   if (failure instanceof Exception) {
2333     throw (Exception) failure;
2334   }
2335   if (failure instanceof Error) {
2336     throw (Error) failure;
2337   }
2338   if (failure != null) {
2339     throw new RuntimeException(failure);
2340   }
2341 }
2342 
testTransformAsync_cancelPropagatesToAsyncOutput()2343 public void testTransformAsync_cancelPropagatesToAsyncOutput() throws Exception {
2344   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2345   testCase.setUp();
2346   Throwable failure = null;
2347   try {
2348     testCase.testTransformAsync_cancelPropagatesToAsyncOutput();
2349   } catch (Throwable t) {
2350     failure = t;
2351   }
2352   try {
2353     testCase.tearDown();
2354   } catch (Throwable t) {
2355     if (failure == null) {
2356       failure = t;
2357     }
2358   }
2359   if (failure instanceof Exception) {
2360     throw (Exception) failure;
2361   }
2362   if (failure instanceof Error) {
2363     throw (Error) failure;
2364   }
2365   if (failure != null) {
2366     throw new RuntimeException(failure);
2367   }
2368 }
2369 
testTransformAsync_cancelPropagatesToInput()2370 public void testTransformAsync_cancelPropagatesToInput() throws Exception {
2371   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2372   testCase.setUp();
2373   Throwable failure = null;
2374   try {
2375     testCase.testTransformAsync_cancelPropagatesToInput();
2376   } catch (Throwable t) {
2377     failure = t;
2378   }
2379   try {
2380     testCase.tearDown();
2381   } catch (Throwable t) {
2382     if (failure == null) {
2383       failure = t;
2384     }
2385   }
2386   if (failure instanceof Exception) {
2387     throw (Exception) failure;
2388   }
2389   if (failure instanceof Error) {
2390     throw (Error) failure;
2391   }
2392   if (failure != null) {
2393     throw new RuntimeException(failure);
2394   }
2395 }
2396 
testTransformAsync_genericsHierarchy_AsyncFunction()2397 public void testTransformAsync_genericsHierarchy_AsyncFunction() throws Exception {
2398   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2399   testCase.setUp();
2400   Throwable failure = null;
2401   try {
2402     testCase.testTransformAsync_genericsHierarchy_AsyncFunction();
2403   } catch (Throwable t) {
2404     failure = t;
2405   }
2406   try {
2407     testCase.tearDown();
2408   } catch (Throwable t) {
2409     if (failure == null) {
2410       failure = t;
2411     }
2412   }
2413   if (failure instanceof Exception) {
2414     throw (Exception) failure;
2415   }
2416   if (failure instanceof Error) {
2417     throw (Error) failure;
2418   }
2419   if (failure != null) {
2420     throw new RuntimeException(failure);
2421   }
2422 }
2423 
testTransformAsync_genericsWildcard_AsyncFunction()2424 public void testTransformAsync_genericsWildcard_AsyncFunction() throws Exception {
2425   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2426   testCase.setUp();
2427   Throwable failure = null;
2428   try {
2429     testCase.testTransformAsync_genericsWildcard_AsyncFunction();
2430   } catch (Throwable t) {
2431     failure = t;
2432   }
2433   try {
2434     testCase.tearDown();
2435   } catch (Throwable t) {
2436     if (failure == null) {
2437       failure = t;
2438     }
2439   }
2440   if (failure instanceof Exception) {
2441     throw (Exception) failure;
2442   }
2443   if (failure instanceof Error) {
2444     throw (Error) failure;
2445   }
2446   if (failure != null) {
2447     throw new RuntimeException(failure);
2448   }
2449 }
2450 
testTransformAsync_getThrowsError()2451 public void testTransformAsync_getThrowsError() throws Exception {
2452   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2453   testCase.setUp();
2454   Throwable failure = null;
2455   try {
2456     testCase.testTransformAsync_getThrowsError();
2457   } catch (Throwable t) {
2458     failure = t;
2459   }
2460   try {
2461     testCase.tearDown();
2462   } catch (Throwable t) {
2463     if (failure == null) {
2464       failure = t;
2465     }
2466   }
2467   if (failure instanceof Exception) {
2468     throw (Exception) failure;
2469   }
2470   if (failure instanceof Error) {
2471     throw (Error) failure;
2472   }
2473   if (failure != null) {
2474     throw new RuntimeException(failure);
2475   }
2476 }
2477 
testTransformAsync_getThrowsRuntimeException()2478 public void testTransformAsync_getThrowsRuntimeException() throws Exception {
2479   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2480   testCase.setUp();
2481   Throwable failure = null;
2482   try {
2483     testCase.testTransformAsync_getThrowsRuntimeException();
2484   } catch (Throwable t) {
2485     failure = t;
2486   }
2487   try {
2488     testCase.tearDown();
2489   } catch (Throwable t) {
2490     if (failure == null) {
2491       failure = t;
2492     }
2493   }
2494   if (failure instanceof Exception) {
2495     throw (Exception) failure;
2496   }
2497   if (failure instanceof Error) {
2498     throw (Error) failure;
2499   }
2500   if (failure != null) {
2501     throw new RuntimeException(failure);
2502   }
2503 }
2504 
testTransformAsync_inputCancelButNotInterruptPropagatesToOutput()2505 public void testTransformAsync_inputCancelButNotInterruptPropagatesToOutput() throws Exception {
2506   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2507   testCase.setUp();
2508   Throwable failure = null;
2509   try {
2510     testCase.testTransformAsync_inputCancelButNotInterruptPropagatesToOutput();
2511   } catch (Throwable t) {
2512     failure = t;
2513   }
2514   try {
2515     testCase.tearDown();
2516   } catch (Throwable t) {
2517     if (failure == null) {
2518       failure = t;
2519     }
2520   }
2521   if (failure instanceof Exception) {
2522     throw (Exception) failure;
2523   }
2524   if (failure instanceof Error) {
2525     throw (Error) failure;
2526   }
2527   if (failure != null) {
2528     throw new RuntimeException(failure);
2529   }
2530 }
2531 
testTransformAsync_interruptPropagatesToAsyncOutput()2532 public void testTransformAsync_interruptPropagatesToAsyncOutput() throws Exception {
2533   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2534   testCase.setUp();
2535   Throwable failure = null;
2536   try {
2537     testCase.testTransformAsync_interruptPropagatesToAsyncOutput();
2538   } catch (Throwable t) {
2539     failure = t;
2540   }
2541   try {
2542     testCase.tearDown();
2543   } catch (Throwable t) {
2544     if (failure == null) {
2545       failure = t;
2546     }
2547   }
2548   if (failure instanceof Exception) {
2549     throw (Exception) failure;
2550   }
2551   if (failure instanceof Error) {
2552     throw (Error) failure;
2553   }
2554   if (failure != null) {
2555     throw new RuntimeException(failure);
2556   }
2557 }
2558 
testTransformAsync_interruptPropagatesToInput()2559 public void testTransformAsync_interruptPropagatesToInput() throws Exception {
2560   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2561   testCase.setUp();
2562   Throwable failure = null;
2563   try {
2564     testCase.testTransformAsync_interruptPropagatesToInput();
2565   } catch (Throwable t) {
2566     failure = t;
2567   }
2568   try {
2569     testCase.tearDown();
2570   } catch (Throwable t) {
2571     if (failure == null) {
2572       failure = t;
2573     }
2574   }
2575   if (failure instanceof Exception) {
2576     throw (Exception) failure;
2577   }
2578   if (failure instanceof Error) {
2579     throw (Error) failure;
2580   }
2581   if (failure != null) {
2582     throw new RuntimeException(failure);
2583   }
2584 }
2585 
testTransformAsync_listenerThrowsError()2586 public void testTransformAsync_listenerThrowsError() throws Exception {
2587   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2588   testCase.setUp();
2589   Throwable failure = null;
2590   try {
2591     testCase.testTransformAsync_listenerThrowsError();
2592   } catch (Throwable t) {
2593     failure = t;
2594   }
2595   try {
2596     testCase.tearDown();
2597   } catch (Throwable t) {
2598     if (failure == null) {
2599       failure = t;
2600     }
2601   }
2602   if (failure instanceof Exception) {
2603     throw (Exception) failure;
2604   }
2605   if (failure instanceof Error) {
2606     throw (Error) failure;
2607   }
2608   if (failure != null) {
2609     throw new RuntimeException(failure);
2610   }
2611 }
2612 
testTransformAsync_rejectionPropagatesToOutput()2613 public void testTransformAsync_rejectionPropagatesToOutput() throws Exception {
2614   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2615   testCase.setUp();
2616   Throwable failure = null;
2617   try {
2618     testCase.testTransformAsync_rejectionPropagatesToOutput();
2619   } catch (Throwable t) {
2620     failure = t;
2621   }
2622   try {
2623     testCase.tearDown();
2624   } catch (Throwable t) {
2625     if (failure == null) {
2626       failure = t;
2627     }
2628   }
2629   if (failure instanceof Exception) {
2630     throw (Exception) failure;
2631   }
2632   if (failure instanceof Error) {
2633     throw (Error) failure;
2634   }
2635   if (failure != null) {
2636     throw new RuntimeException(failure);
2637   }
2638 }
2639 
testTransformValueRemainsMemoized()2640 public void testTransformValueRemainsMemoized() throws Exception {
2641   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2642   testCase.setUp();
2643   Throwable failure = null;
2644   try {
2645     testCase.testTransformValueRemainsMemoized();
2646   } catch (Throwable t) {
2647     failure = t;
2648   }
2649   try {
2650     testCase.tearDown();
2651   } catch (Throwable t) {
2652     if (failure == null) {
2653       failure = t;
2654     }
2655   }
2656   if (failure instanceof Exception) {
2657     throw (Exception) failure;
2658   }
2659   if (failure instanceof Error) {
2660     throw (Error) failure;
2661   }
2662   if (failure != null) {
2663     throw new RuntimeException(failure);
2664   }
2665 }
2666 
testTransform_ErrorAfterCancellation()2667 public void testTransform_ErrorAfterCancellation() throws Exception {
2668   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2669   testCase.setUp();
2670   Throwable failure = null;
2671   try {
2672     testCase.testTransform_ErrorAfterCancellation();
2673   } catch (Throwable t) {
2674     failure = t;
2675   }
2676   try {
2677     testCase.tearDown();
2678   } catch (Throwable t) {
2679     if (failure == null) {
2680       failure = t;
2681     }
2682   }
2683   if (failure instanceof Exception) {
2684     throw (Exception) failure;
2685   }
2686   if (failure instanceof Error) {
2687     throw (Error) failure;
2688   }
2689   if (failure != null) {
2690     throw new RuntimeException(failure);
2691   }
2692 }
2693 
testTransform_ExceptionAfterCancellation()2694 public void testTransform_ExceptionAfterCancellation() throws Exception {
2695   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2696   testCase.setUp();
2697   Throwable failure = null;
2698   try {
2699     testCase.testTransform_ExceptionAfterCancellation();
2700   } catch (Throwable t) {
2701     failure = t;
2702   }
2703   try {
2704     testCase.tearDown();
2705   } catch (Throwable t) {
2706     if (failure == null) {
2707       failure = t;
2708     }
2709   }
2710   if (failure instanceof Exception) {
2711     throw (Exception) failure;
2712   }
2713   if (failure instanceof Error) {
2714     throw (Error) failure;
2715   }
2716   if (failure != null) {
2717     throw new RuntimeException(failure);
2718   }
2719 }
2720 
testTransform_Executor()2721 public void testTransform_Executor() throws Exception {
2722   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2723   testCase.setUp();
2724   Throwable failure = null;
2725   try {
2726     testCase.testTransform_Executor();
2727   } catch (Throwable t) {
2728     failure = t;
2729   }
2730   try {
2731     testCase.tearDown();
2732   } catch (Throwable t) {
2733     if (failure == null) {
2734       failure = t;
2735     }
2736   }
2737   if (failure instanceof Exception) {
2738     throw (Exception) failure;
2739   }
2740   if (failure instanceof Error) {
2741     throw (Error) failure;
2742   }
2743   if (failure != null) {
2744     throw new RuntimeException(failure);
2745   }
2746 }
2747 
testTransform_genericsHierarchy()2748 public void testTransform_genericsHierarchy() throws Exception {
2749   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2750   testCase.setUp();
2751   Throwable failure = null;
2752   try {
2753     testCase.testTransform_genericsHierarchy();
2754   } catch (Throwable t) {
2755     failure = t;
2756   }
2757   try {
2758     testCase.tearDown();
2759   } catch (Throwable t) {
2760     if (failure == null) {
2761       failure = t;
2762     }
2763   }
2764   if (failure instanceof Exception) {
2765     throw (Exception) failure;
2766   }
2767   if (failure instanceof Error) {
2768     throw (Error) failure;
2769   }
2770   if (failure != null) {
2771     throw new RuntimeException(failure);
2772   }
2773 }
2774 
testTransform_genericsNull()2775 public void testTransform_genericsNull() throws Exception {
2776   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2777   testCase.setUp();
2778   Throwable failure = null;
2779   try {
2780     testCase.testTransform_genericsNull();
2781   } catch (Throwable t) {
2782     failure = t;
2783   }
2784   try {
2785     testCase.tearDown();
2786   } catch (Throwable t) {
2787     if (failure == null) {
2788       failure = t;
2789     }
2790   }
2791   if (failure instanceof Exception) {
2792     throw (Exception) failure;
2793   }
2794   if (failure instanceof Error) {
2795     throw (Error) failure;
2796   }
2797   if (failure != null) {
2798     throw new RuntimeException(failure);
2799   }
2800 }
2801 
testTransform_getThrowsError()2802 public void testTransform_getThrowsError() throws Exception {
2803   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2804   testCase.setUp();
2805   Throwable failure = null;
2806   try {
2807     testCase.testTransform_getThrowsError();
2808   } catch (Throwable t) {
2809     failure = t;
2810   }
2811   try {
2812     testCase.tearDown();
2813   } catch (Throwable t) {
2814     if (failure == null) {
2815       failure = t;
2816     }
2817   }
2818   if (failure instanceof Exception) {
2819     throw (Exception) failure;
2820   }
2821   if (failure instanceof Error) {
2822     throw (Error) failure;
2823   }
2824   if (failure != null) {
2825     throw new RuntimeException(failure);
2826   }
2827 }
2828 
testTransform_getThrowsRuntimeException()2829 public void testTransform_getThrowsRuntimeException() throws Exception {
2830   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2831   testCase.setUp();
2832   Throwable failure = null;
2833   try {
2834     testCase.testTransform_getThrowsRuntimeException();
2835   } catch (Throwable t) {
2836     failure = t;
2837   }
2838   try {
2839     testCase.tearDown();
2840   } catch (Throwable t) {
2841     if (failure == null) {
2842       failure = t;
2843     }
2844   }
2845   if (failure instanceof Exception) {
2846     throw (Exception) failure;
2847   }
2848   if (failure instanceof Error) {
2849     throw (Error) failure;
2850   }
2851   if (failure != null) {
2852     throw new RuntimeException(failure);
2853   }
2854 }
2855 
testTransform_listenerThrowsError()2856 public void testTransform_listenerThrowsError() throws Exception {
2857   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2858   testCase.setUp();
2859   Throwable failure = null;
2860   try {
2861     testCase.testTransform_listenerThrowsError();
2862   } catch (Throwable t) {
2863     failure = t;
2864   }
2865   try {
2866     testCase.tearDown();
2867   } catch (Throwable t) {
2868     if (failure == null) {
2869       failure = t;
2870     }
2871   }
2872   if (failure instanceof Exception) {
2873     throw (Exception) failure;
2874   }
2875   if (failure instanceof Error) {
2876     throw (Error) failure;
2877   }
2878   if (failure != null) {
2879     throw new RuntimeException(failure);
2880   }
2881 }
2882 
testTransform_rejectionPropagatesToOutput()2883 public void testTransform_rejectionPropagatesToOutput() throws Exception {
2884   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2885   testCase.setUp();
2886   Throwable failure = null;
2887   try {
2888     testCase.testTransform_rejectionPropagatesToOutput();
2889   } catch (Throwable t) {
2890     failure = t;
2891   }
2892   try {
2893     testCase.tearDown();
2894   } catch (Throwable t) {
2895     if (failure == null) {
2896       failure = t;
2897     }
2898   }
2899   if (failure instanceof Exception) {
2900     throw (Exception) failure;
2901   }
2902   if (failure instanceof Error) {
2903     throw (Error) failure;
2904   }
2905   if (failure != null) {
2906     throw new RuntimeException(failure);
2907   }
2908 }
2909 
testWhenAllComplete_asyncError()2910 public void testWhenAllComplete_asyncError() throws Exception {
2911   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2912   testCase.setUp();
2913   Throwable failure = null;
2914   try {
2915     testCase.testWhenAllComplete_asyncError();
2916   } catch (Throwable t) {
2917     failure = t;
2918   }
2919   try {
2920     testCase.tearDown();
2921   } catch (Throwable t) {
2922     if (failure == null) {
2923       failure = t;
2924     }
2925   }
2926   if (failure instanceof Exception) {
2927     throw (Exception) failure;
2928   }
2929   if (failure instanceof Error) {
2930     throw (Error) failure;
2931   }
2932   if (failure != null) {
2933     throw new RuntimeException(failure);
2934   }
2935 }
2936 
testWhenAllComplete_asyncResult()2937 public void testWhenAllComplete_asyncResult() throws Exception {
2938   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2939   testCase.setUp();
2940   Throwable failure = null;
2941   try {
2942     testCase.testWhenAllComplete_asyncResult();
2943   } catch (Throwable t) {
2944     failure = t;
2945   }
2946   try {
2947     testCase.tearDown();
2948   } catch (Throwable t) {
2949     if (failure == null) {
2950       failure = t;
2951     }
2952   }
2953   if (failure instanceof Exception) {
2954     throw (Exception) failure;
2955   }
2956   if (failure instanceof Error) {
2957     throw (Error) failure;
2958   }
2959   if (failure != null) {
2960     throw new RuntimeException(failure);
2961   }
2962 }
2963 
testWhenAllComplete_runnableError()2964 public void testWhenAllComplete_runnableError() throws Exception {
2965   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2966   testCase.setUp();
2967   Throwable failure = null;
2968   try {
2969     testCase.testWhenAllComplete_runnableError();
2970   } catch (Throwable t) {
2971     failure = t;
2972   }
2973   try {
2974     testCase.tearDown();
2975   } catch (Throwable t) {
2976     if (failure == null) {
2977       failure = t;
2978     }
2979   }
2980   if (failure instanceof Exception) {
2981     throw (Exception) failure;
2982   }
2983   if (failure instanceof Error) {
2984     throw (Error) failure;
2985   }
2986   if (failure != null) {
2987     throw new RuntimeException(failure);
2988   }
2989 }
2990 
testWhenAllComplete_runnableResult()2991 public void testWhenAllComplete_runnableResult() throws Exception {
2992   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
2993   testCase.setUp();
2994   Throwable failure = null;
2995   try {
2996     testCase.testWhenAllComplete_runnableResult();
2997   } catch (Throwable t) {
2998     failure = t;
2999   }
3000   try {
3001     testCase.tearDown();
3002   } catch (Throwable t) {
3003     if (failure == null) {
3004       failure = t;
3005     }
3006   }
3007   if (failure instanceof Exception) {
3008     throw (Exception) failure;
3009   }
3010   if (failure instanceof Error) {
3011     throw (Error) failure;
3012   }
3013   if (failure != null) {
3014     throw new RuntimeException(failure);
3015   }
3016 }
3017 
testWhenAllComplete_wildcard()3018 public void testWhenAllComplete_wildcard() throws Exception {
3019   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
3020   testCase.setUp();
3021   Throwable failure = null;
3022   try {
3023     testCase.testWhenAllComplete_wildcard();
3024   } catch (Throwable t) {
3025     failure = t;
3026   }
3027   try {
3028     testCase.tearDown();
3029   } catch (Throwable t) {
3030     if (failure == null) {
3031       failure = t;
3032     }
3033   }
3034   if (failure instanceof Exception) {
3035     throw (Exception) failure;
3036   }
3037   if (failure instanceof Error) {
3038     throw (Error) failure;
3039   }
3040   if (failure != null) {
3041     throw new RuntimeException(failure);
3042   }
3043 }
3044 
testWhenAllSucceed()3045 public void testWhenAllSucceed() throws Exception {
3046   com.google.common.util.concurrent.FuturesTest testCase = new com.google.common.util.concurrent.FuturesTest();
3047   testCase.setUp();
3048   Throwable failure = null;
3049   try {
3050     testCase.testWhenAllSucceed();
3051   } catch (Throwable t) {
3052     failure = t;
3053   }
3054   try {
3055     testCase.tearDown();
3056   } catch (Throwable t) {
3057     if (failure == null) {
3058       failure = t;
3059     }
3060   }
3061   if (failure instanceof Exception) {
3062     throw (Exception) failure;
3063   }
3064   if (failure instanceof Error) {
3065     throw (Error) failure;
3066   }
3067   if (failure != null) {
3068     throw new RuntimeException(failure);
3069   }
3070 }
3071 }
3072