524 |
|
* completed tasks; getRawResult returns null. |
525 |
|
*/ |
526 |
|
public void testInvoke() { |
527 |
< |
ForkJoinTask a = new CheckedFJTask() { |
527 |
> |
ForkJoinTask a = new CheckedFJTask() { |
528 |
|
public void realCompute() { |
529 |
|
CCF f = new LCCF(null, 8); |
530 |
|
assertNull(f.invoke()); |
540 |
|
* completed tasks |
541 |
|
*/ |
542 |
|
public void testQuietlyInvoke() { |
543 |
< |
ForkJoinTask a = new CheckedFJTask() { |
543 |
> |
ForkJoinTask a = new CheckedFJTask() { |
544 |
|
public void realCompute() { |
545 |
|
CCF f = new LCCF(null, 8); |
546 |
|
f.quietlyInvoke(); |
554 |
|
* join of a forked task returns when task completes |
555 |
|
*/ |
556 |
|
public void testForkJoin() { |
557 |
< |
ForkJoinTask a = new CheckedFJTask() { |
557 |
> |
ForkJoinTask a = new CheckedFJTask() { |
558 |
|
public void realCompute() { |
559 |
|
CCF f = new LCCF(null, 8); |
560 |
|
assertSame(f, f.fork()); |
569 |
|
* get of a forked task returns when task completes |
570 |
|
*/ |
571 |
|
public void testForkGet() { |
572 |
< |
ForkJoinTask a = new CheckedFJTask() { |
572 |
> |
ForkJoinTask a = new CheckedFJTask() { |
573 |
|
public void realCompute() throws Exception { |
574 |
|
CCF f = new LCCF(null, 8); |
575 |
|
assertSame(f, f.fork()); |
584 |
|
* timed get of a forked task returns when task completes |
585 |
|
*/ |
586 |
|
public void testForkTimedGet() { |
587 |
< |
ForkJoinTask a = new CheckedFJTask() { |
587 |
> |
ForkJoinTask a = new CheckedFJTask() { |
588 |
|
public void realCompute() throws Exception { |
589 |
|
CCF f = new LCCF(null, 8); |
590 |
|
assertSame(f, f.fork()); |
599 |
|
* timed get with null time unit throws NPE |
600 |
|
*/ |
601 |
|
public void testForkTimedGetNPE() { |
602 |
< |
ForkJoinTask a = new CheckedFJTask() { |
602 |
> |
ForkJoinTask a = new CheckedFJTask() { |
603 |
|
public void realCompute() throws Exception { |
604 |
|
CCF f = new LCCF(null, 8); |
605 |
|
assertSame(f, f.fork()); |
615 |
|
* quietlyJoin of a forked task returns when task completes |
616 |
|
*/ |
617 |
|
public void testForkQuietlyJoin() { |
618 |
< |
ForkJoinTask a = new CheckedFJTask() { |
618 |
> |
ForkJoinTask a = new CheckedFJTask() { |
619 |
|
public void realCompute() { |
620 |
|
CCF f = new LCCF(null, 8); |
621 |
|
assertSame(f, f.fork()); |
631 |
|
* getQueuedTaskCount returns 0 when quiescent |
632 |
|
*/ |
633 |
|
public void testForkHelpQuiesce() { |
634 |
< |
ForkJoinTask a = new CheckedFJTask() { |
634 |
> |
ForkJoinTask a = new CheckedFJTask() { |
635 |
|
public void realCompute() { |
636 |
|
CCF f = new LCCF(null, 8); |
637 |
|
assertSame(f, f.fork()); |
647 |
|
* invoke task throws exception when task completes abnormally |
648 |
|
*/ |
649 |
|
public void testAbnormalInvoke() { |
650 |
< |
ForkJoinTask a = new CheckedFJTask() { |
650 |
> |
ForkJoinTask a = new CheckedFJTask() { |
651 |
|
public void realCompute() { |
652 |
|
FailingCCF f = new LFCCF(null, 8); |
653 |
|
try { |
664 |
|
* quietlyInvoke task returns when task completes abnormally |
665 |
|
*/ |
666 |
|
public void testAbnormalQuietlyInvoke() { |
667 |
< |
ForkJoinTask a = new CheckedFJTask() { |
667 |
> |
ForkJoinTask a = new CheckedFJTask() { |
668 |
|
public void realCompute() { |
669 |
|
FailingCCF f = new LFCCF(null, 8); |
670 |
|
f.quietlyInvoke(); |
678 |
|
* join of a forked task throws exception when task completes abnormally |
679 |
|
*/ |
680 |
|
public void testAbnormalForkJoin() { |
681 |
< |
ForkJoinTask a = new CheckedFJTask() { |
681 |
> |
ForkJoinTask a = new CheckedFJTask() { |
682 |
|
public void realCompute() { |
683 |
|
FailingCCF f = new LFCCF(null, 8); |
684 |
|
assertSame(f, f.fork()); |
696 |
|
* get of a forked task throws exception when task completes abnormally |
697 |
|
*/ |
698 |
|
public void testAbnormalForkGet() { |
699 |
< |
ForkJoinTask a = new CheckedFJTask() { |
699 |
> |
ForkJoinTask a = new CheckedFJTask() { |
700 |
|
public void realCompute() throws Exception { |
701 |
|
FailingCCF f = new LFCCF(null, 8); |
702 |
|
assertSame(f, f.fork()); |
716 |
|
* timed get of a forked task throws exception when task completes abnormally |
717 |
|
*/ |
718 |
|
public void testAbnormalForkTimedGet() { |
719 |
< |
ForkJoinTask a = new CheckedFJTask() { |
719 |
> |
ForkJoinTask a = new CheckedFJTask() { |
720 |
|
public void realCompute() throws Exception { |
721 |
|
FailingCCF f = new LFCCF(null, 8); |
722 |
|
assertSame(f, f.fork()); |
736 |
|
* quietlyJoin of a forked task returns when task completes abnormally |
737 |
|
*/ |
738 |
|
public void testAbnormalForkQuietlyJoin() { |
739 |
< |
ForkJoinTask a = new CheckedFJTask() { |
739 |
> |
ForkJoinTask a = new CheckedFJTask() { |
740 |
|
public void realCompute() { |
741 |
|
FailingCCF f = new LFCCF(null, 8); |
742 |
|
assertSame(f, f.fork()); |
751 |
|
* invoke task throws exception when task cancelled |
752 |
|
*/ |
753 |
|
public void testCancelledInvoke() { |
754 |
< |
ForkJoinTask a = new CheckedFJTask() { |
754 |
> |
ForkJoinTask a = new CheckedFJTask() { |
755 |
|
public void realCompute() { |
756 |
|
CCF f = new LCCF(null, 8); |
757 |
|
assertTrue(f.cancel(true)); |
769 |
|
* join of a forked task throws exception when task cancelled |
770 |
|
*/ |
771 |
|
public void testCancelledForkJoin() { |
772 |
< |
ForkJoinTask a = new CheckedFJTask() { |
772 |
> |
ForkJoinTask a = new CheckedFJTask() { |
773 |
|
public void realCompute() { |
774 |
|
CCF f = new LCCF(null, 8); |
775 |
|
assertTrue(f.cancel(true)); |
788 |
|
* get of a forked task throws exception when task cancelled |
789 |
|
*/ |
790 |
|
public void testCancelledForkGet() { |
791 |
< |
ForkJoinTask a = new CheckedFJTask() { |
791 |
> |
ForkJoinTask a = new CheckedFJTask() { |
792 |
|
public void realCompute() throws Exception { |
793 |
|
CCF f = new LCCF(null, 8); |
794 |
|
assertTrue(f.cancel(true)); |
807 |
|
* timed get of a forked task throws exception when task cancelled |
808 |
|
*/ |
809 |
|
public void testCancelledForkTimedGet() throws Exception { |
810 |
< |
ForkJoinTask a = new CheckedFJTask() { |
810 |
> |
ForkJoinTask a = new CheckedFJTask() { |
811 |
|
public void realCompute() throws Exception { |
812 |
|
CCF f = new LCCF(null, 8); |
813 |
|
assertTrue(f.cancel(true)); |
826 |
|
* quietlyJoin of a forked task returns when task cancelled |
827 |
|
*/ |
828 |
|
public void testCancelledForkQuietlyJoin() { |
829 |
< |
ForkJoinTask a = new CheckedFJTask() { |
829 |
> |
ForkJoinTask a = new CheckedFJTask() { |
830 |
|
public void realCompute() { |
831 |
|
CCF f = new LCCF(null, 8); |
832 |
|
assertTrue(f.cancel(true)); |
842 |
|
*/ |
843 |
|
public void testGetPool() { |
844 |
|
final ForkJoinPool mainPool = mainPool(); |
845 |
< |
ForkJoinTask a = new CheckedFJTask() { |
845 |
> |
ForkJoinTask a = new CheckedFJTask() { |
846 |
|
public void realCompute() { |
847 |
|
assertSame(mainPool, getPool()); |
848 |
|
}}; |
853 |
|
* getPool of non-FJ task returns null |
854 |
|
*/ |
855 |
|
public void testGetPool2() { |
856 |
< |
ForkJoinTask a = new CheckedFJTask() { |
856 |
> |
ForkJoinTask a = new CheckedFJTask() { |
857 |
|
public void realCompute() { |
858 |
|
assertNull(getPool()); |
859 |
|
}}; |
864 |
|
* inForkJoinPool of executing task returns true |
865 |
|
*/ |
866 |
|
public void testInForkJoinPool() { |
867 |
< |
ForkJoinTask a = new CheckedFJTask() { |
867 |
> |
ForkJoinTask a = new CheckedFJTask() { |
868 |
|
public void realCompute() { |
869 |
|
assertTrue(inForkJoinPool()); |
870 |
|
}}; |
875 |
|
* inForkJoinPool of non-FJ task returns false |
876 |
|
*/ |
877 |
|
public void testInForkJoinPool2() { |
878 |
< |
ForkJoinTask a = new CheckedFJTask() { |
878 |
> |
ForkJoinTask a = new CheckedFJTask() { |
879 |
|
public void realCompute() { |
880 |
|
assertFalse(inForkJoinPool()); |
881 |
|
}}; |
886 |
|
* setRawResult(null) succeeds |
887 |
|
*/ |
888 |
|
public void testSetRawResult() { |
889 |
< |
ForkJoinTask a = new CheckedFJTask() { |
889 |
> |
ForkJoinTask a = new CheckedFJTask() { |
890 |
|
public void realCompute() { |
891 |
|
setRawResult(null); |
892 |
|
assertNull(getRawResult()); |
898 |
|
* invoke task throws exception after invoking completeExceptionally |
899 |
|
*/ |
900 |
|
public void testCompleteExceptionally2() { |
901 |
< |
ForkJoinTask a = new CheckedFJTask() { |
901 |
> |
ForkJoinTask a = new CheckedFJTask() { |
902 |
|
public void realCompute() { |
903 |
|
CCF f = new LCCF(null, 8); |
904 |
|
f.completeExceptionally(new FJException()); |
916 |
|
* invokeAll(t1, t2) invokes all task arguments |
917 |
|
*/ |
918 |
|
public void testInvokeAll2() { |
919 |
< |
ForkJoinTask a = new CheckedFJTask() { |
919 |
> |
ForkJoinTask a = new CheckedFJTask() { |
920 |
|
public void realCompute() { |
921 |
|
CCF f = new LCCF(null, 8); |
922 |
|
CCF g = new LCCF(null, 9); |
933 |
|
* invokeAll(tasks) with 1 argument invokes task |
934 |
|
*/ |
935 |
|
public void testInvokeAll1() { |
936 |
< |
ForkJoinTask a = new CheckedFJTask() { |
936 |
> |
ForkJoinTask a = new CheckedFJTask() { |
937 |
|
public void realCompute() { |
938 |
|
CCF f = new LCCF(null, 8); |
939 |
|
invokeAll(f); |
947 |
|
* invokeAll(tasks) with > 2 argument invokes tasks |
948 |
|
*/ |
949 |
|
public void testInvokeAll3() { |
950 |
< |
ForkJoinTask a = new CheckedFJTask() { |
950 |
> |
ForkJoinTask a = new CheckedFJTask() { |
951 |
|
public void realCompute() { |
952 |
|
CCF f = new LCCF(null, 8); |
953 |
|
CCF g = new LCCF(null, 9); |
967 |
|
* invokeAll(collection) invokes all tasks in the collection |
968 |
|
*/ |
969 |
|
public void testInvokeAllCollection() { |
970 |
< |
ForkJoinTask a = new CheckedFJTask() { |
970 |
> |
ForkJoinTask a = new CheckedFJTask() { |
971 |
|
public void realCompute() { |
972 |
|
CCF f = new LCCF(null, 8); |
973 |
|
CCF g = new LCCF(null, 9); |
991 |
|
* invokeAll(tasks) with any null task throws NPE |
992 |
|
*/ |
993 |
|
public void testInvokeAllNPE() { |
994 |
< |
ForkJoinTask a = new CheckedFJTask() { |
994 |
> |
ForkJoinTask a = new CheckedFJTask() { |
995 |
|
public void realCompute() { |
996 |
|
CCF f = new LCCF(null, 8); |
997 |
|
CCF g = new LCCF(null, 9); |
1008 |
|
* invokeAll(t1, t2) throw exception if any task does |
1009 |
|
*/ |
1010 |
|
public void testAbnormalInvokeAll2() { |
1011 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1011 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1012 |
|
public void realCompute() { |
1013 |
|
CCF f = new LCCF(null, 8); |
1014 |
|
FailingCCF g = new LFCCF(null, 9); |
1026 |
|
* invokeAll(tasks) with 1 argument throws exception if task does |
1027 |
|
*/ |
1028 |
|
public void testAbnormalInvokeAll1() { |
1029 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1029 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1030 |
|
public void realCompute() { |
1031 |
|
FailingCCF g = new LFCCF(null, 9); |
1032 |
|
try { |
1043 |
|
* invokeAll(tasks) with > 2 argument throws exception if any task does |
1044 |
|
*/ |
1045 |
|
public void testAbnormalInvokeAll3() { |
1046 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1046 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1047 |
|
public void realCompute() { |
1048 |
|
CCF f = new LCCF(null, 8); |
1049 |
|
FailingCCF g = new LFCCF(null, 9); |
1062 |
|
* invokeAll(collection) throws exception if any task does |
1063 |
|
*/ |
1064 |
|
public void testAbnormalInvokeAllCollection() { |
1065 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1065 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1066 |
|
public void realCompute() { |
1067 |
|
FailingCCF f = new LFCCF(null, 8); |
1068 |
|
CCF g = new LCCF(null, 9); |
1086 |
|
* and suppresses execution |
1087 |
|
*/ |
1088 |
|
public void testTryUnfork() { |
1089 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1089 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1090 |
|
public void realCompute() { |
1091 |
|
CCF g = new LCCF(null, 9); |
1092 |
|
assertSame(g, g.fork()); |
1105 |
|
* there are more tasks than threads |
1106 |
|
*/ |
1107 |
|
public void testGetSurplusQueuedTaskCount() { |
1108 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1108 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1109 |
|
public void realCompute() { |
1110 |
|
CCF h = new LCCF(null, 7); |
1111 |
|
assertSame(h, h.fork()); |
1127 |
|
* peekNextLocalTask returns most recent unexecuted task. |
1128 |
|
*/ |
1129 |
|
public void testPeekNextLocalTask() { |
1130 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1130 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1131 |
|
public void realCompute() { |
1132 |
|
CCF g = new LCCF(null, 9); |
1133 |
|
assertSame(g, g.fork()); |
1147 |
|
* executing it |
1148 |
|
*/ |
1149 |
|
public void testPollNextLocalTask() { |
1150 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1150 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1151 |
|
public void realCompute() { |
1152 |
|
CCF g = new LCCF(null, 9); |
1153 |
|
assertSame(g, g.fork()); |
1166 |
|
* pollTask returns an unexecuted task without executing it |
1167 |
|
*/ |
1168 |
|
public void testPollTask() { |
1169 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1169 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1170 |
|
public void realCompute() { |
1171 |
|
CCF g = new LCCF(null, 9); |
1172 |
|
assertSame(g, g.fork()); |
1184 |
|
* peekNextLocalTask returns least recent unexecuted task in async mode |
1185 |
|
*/ |
1186 |
|
public void testPeekNextLocalTaskAsync() { |
1187 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1187 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1188 |
|
public void realCompute() { |
1189 |
|
CCF g = new LCCF(null, 9); |
1190 |
|
assertSame(g, g.fork()); |
1205 |
|
* executing it, in async mode |
1206 |
|
*/ |
1207 |
|
public void testPollNextLocalTaskAsync() { |
1208 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1208 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1209 |
|
public void realCompute() { |
1210 |
|
CCF g = new LCCF(null, 9); |
1211 |
|
assertSame(g, g.fork()); |
1225 |
|
* async mode |
1226 |
|
*/ |
1227 |
|
public void testPollTaskAsync() { |
1228 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1228 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1229 |
|
public void realCompute() { |
1230 |
|
CCF g = new LCCF(null, 9); |
1231 |
|
assertSame(g, g.fork()); |
1248 |
|
* completed tasks; getRawResult returns null. |
1249 |
|
*/ |
1250 |
|
public void testInvokeSingleton() { |
1251 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1251 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1252 |
|
public void realCompute() { |
1253 |
|
CCF f = new LCCF(null, 8); |
1254 |
|
assertNull(f.invoke()); |
1264 |
|
* completed tasks |
1265 |
|
*/ |
1266 |
|
public void testQuietlyInvokeSingleton() { |
1267 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1267 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1268 |
|
public void realCompute() { |
1269 |
|
CCF f = new LCCF(null, 8); |
1270 |
|
f.quietlyInvoke(); |
1278 |
|
* join of a forked task returns when task completes |
1279 |
|
*/ |
1280 |
|
public void testForkJoinSingleton() { |
1281 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1281 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1282 |
|
public void realCompute() { |
1283 |
|
CCF f = new LCCF(null, 8); |
1284 |
|
assertSame(f, f.fork()); |
1293 |
|
* get of a forked task returns when task completes |
1294 |
|
*/ |
1295 |
|
public void testForkGetSingleton() { |
1296 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1296 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1297 |
|
public void realCompute() throws Exception { |
1298 |
|
CCF f = new LCCF(null, 8); |
1299 |
|
assertSame(f, f.fork()); |
1308 |
|
* timed get of a forked task returns when task completes |
1309 |
|
*/ |
1310 |
|
public void testForkTimedGetSingleton() { |
1311 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1311 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1312 |
|
public void realCompute() throws Exception { |
1313 |
|
CCF f = new LCCF(null, 8); |
1314 |
|
assertSame(f, f.fork()); |
1323 |
|
* timed get with null time unit throws NPE |
1324 |
|
*/ |
1325 |
|
public void testForkTimedGetNPESingleton() { |
1326 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1326 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1327 |
|
public void realCompute() throws Exception { |
1328 |
|
CCF f = new LCCF(null, 8); |
1329 |
|
assertSame(f, f.fork()); |
1339 |
|
* quietlyJoin of a forked task returns when task completes |
1340 |
|
*/ |
1341 |
|
public void testForkQuietlyJoinSingleton() { |
1342 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1342 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1343 |
|
public void realCompute() { |
1344 |
|
CCF f = new LCCF(null, 8); |
1345 |
|
assertSame(f, f.fork()); |
1355 |
|
* getQueuedTaskCount returns 0 when quiescent |
1356 |
|
*/ |
1357 |
|
public void testForkHelpQuiesceSingleton() { |
1358 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1358 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1359 |
|
public void realCompute() { |
1360 |
|
CCF f = new LCCF(null, 8); |
1361 |
|
assertSame(f, f.fork()); |
1371 |
|
* invoke task throws exception when task completes abnormally |
1372 |
|
*/ |
1373 |
|
public void testAbnormalInvokeSingleton() { |
1374 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1374 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1375 |
|
public void realCompute() { |
1376 |
|
FailingCCF f = new LFCCF(null, 8); |
1377 |
|
try { |
1388 |
|
* quietlyInvoke task returns when task completes abnormally |
1389 |
|
*/ |
1390 |
|
public void testAbnormalQuietlyInvokeSingleton() { |
1391 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1391 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1392 |
|
public void realCompute() { |
1393 |
|
FailingCCF f = new LFCCF(null, 8); |
1394 |
|
f.quietlyInvoke(); |
1402 |
|
* join of a forked task throws exception when task completes abnormally |
1403 |
|
*/ |
1404 |
|
public void testAbnormalForkJoinSingleton() { |
1405 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1405 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1406 |
|
public void realCompute() { |
1407 |
|
FailingCCF f = new LFCCF(null, 8); |
1408 |
|
assertSame(f, f.fork()); |
1420 |
|
* get of a forked task throws exception when task completes abnormally |
1421 |
|
*/ |
1422 |
|
public void testAbnormalForkGetSingleton() { |
1423 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1423 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1424 |
|
public void realCompute() throws Exception { |
1425 |
|
FailingCCF f = new LFCCF(null, 8); |
1426 |
|
assertSame(f, f.fork()); |
1440 |
|
* timed get of a forked task throws exception when task completes abnormally |
1441 |
|
*/ |
1442 |
|
public void testAbnormalForkTimedGetSingleton() { |
1443 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1443 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1444 |
|
public void realCompute() throws Exception { |
1445 |
|
FailingCCF f = new LFCCF(null, 8); |
1446 |
|
assertSame(f, f.fork()); |
1460 |
|
* quietlyJoin of a forked task returns when task completes abnormally |
1461 |
|
*/ |
1462 |
|
public void testAbnormalForkQuietlyJoinSingleton() { |
1463 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1463 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1464 |
|
public void realCompute() { |
1465 |
|
FailingCCF f = new LFCCF(null, 8); |
1466 |
|
assertSame(f, f.fork()); |
1475 |
|
* invoke task throws exception when task cancelled |
1476 |
|
*/ |
1477 |
|
public void testCancelledInvokeSingleton() { |
1478 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1478 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1479 |
|
public void realCompute() { |
1480 |
|
CCF f = new LCCF(null, 8); |
1481 |
|
assertTrue(f.cancel(true)); |
1493 |
|
* join of a forked task throws exception when task cancelled |
1494 |
|
*/ |
1495 |
|
public void testCancelledForkJoinSingleton() { |
1496 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1496 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1497 |
|
public void realCompute() { |
1498 |
|
CCF f = new LCCF(null, 8); |
1499 |
|
assertTrue(f.cancel(true)); |
1512 |
|
* get of a forked task throws exception when task cancelled |
1513 |
|
*/ |
1514 |
|
public void testCancelledForkGetSingleton() { |
1515 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1515 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1516 |
|
public void realCompute() throws Exception { |
1517 |
|
CCF f = new LCCF(null, 8); |
1518 |
|
assertTrue(f.cancel(true)); |
1531 |
|
* timed get of a forked task throws exception when task cancelled |
1532 |
|
*/ |
1533 |
|
public void testCancelledForkTimedGetSingleton() throws Exception { |
1534 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1534 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1535 |
|
public void realCompute() throws Exception { |
1536 |
|
CCF f = new LCCF(null, 8); |
1537 |
|
assertTrue(f.cancel(true)); |
1550 |
|
* quietlyJoin of a forked task returns when task cancelled |
1551 |
|
*/ |
1552 |
|
public void testCancelledForkQuietlyJoinSingleton() { |
1553 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1553 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1554 |
|
public void realCompute() { |
1555 |
|
CCF f = new LCCF(null, 8); |
1556 |
|
assertTrue(f.cancel(true)); |
1565 |
|
* invoke task throws exception after invoking completeExceptionally |
1566 |
|
*/ |
1567 |
|
public void testCompleteExceptionallySingleton() { |
1568 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1568 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1569 |
|
public void realCompute() { |
1570 |
|
CCF f = new LCCF(null, 8); |
1571 |
|
f.completeExceptionally(new FJException()); |
1583 |
|
* invokeAll(t1, t2) invokes all task arguments |
1584 |
|
*/ |
1585 |
|
public void testInvokeAll2Singleton() { |
1586 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1586 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1587 |
|
public void realCompute() { |
1588 |
|
CCF f = new LCCF(null, 8); |
1589 |
|
CCF g = new LCCF(null, 9); |
1600 |
|
* invokeAll(tasks) with 1 argument invokes task |
1601 |
|
*/ |
1602 |
|
public void testInvokeAll1Singleton() { |
1603 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1603 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1604 |
|
public void realCompute() { |
1605 |
|
CCF f = new LCCF(null, 8); |
1606 |
|
invokeAll(f); |
1614 |
|
* invokeAll(tasks) with > 2 argument invokes tasks |
1615 |
|
*/ |
1616 |
|
public void testInvokeAll3Singleton() { |
1617 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1617 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1618 |
|
public void realCompute() { |
1619 |
|
CCF f = new LCCF(null, 8); |
1620 |
|
CCF g = new LCCF(null, 9); |
1634 |
|
* invokeAll(collection) invokes all tasks in the collection |
1635 |
|
*/ |
1636 |
|
public void testInvokeAllCollectionSingleton() { |
1637 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1637 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1638 |
|
public void realCompute() { |
1639 |
|
CCF f = new LCCF(null, 8); |
1640 |
|
CCF g = new LCCF(null, 9); |
1658 |
|
* invokeAll(tasks) with any null task throws NPE |
1659 |
|
*/ |
1660 |
|
public void testInvokeAllNPESingleton() { |
1661 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1661 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1662 |
|
public void realCompute() { |
1663 |
|
CCF f = new LCCF(null, 8); |
1664 |
|
CCF g = new LCCF(null, 9); |
1675 |
|
* invokeAll(t1, t2) throw exception if any task does |
1676 |
|
*/ |
1677 |
|
public void testAbnormalInvokeAll2Singleton() { |
1678 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1678 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1679 |
|
public void realCompute() { |
1680 |
|
CCF f = new LCCF(null, 8); |
1681 |
|
FailingCCF g = new LFCCF(null, 9); |
1693 |
|
* invokeAll(tasks) with 1 argument throws exception if task does |
1694 |
|
*/ |
1695 |
|
public void testAbnormalInvokeAll1Singleton() { |
1696 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1696 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1697 |
|
public void realCompute() { |
1698 |
|
FailingCCF g = new LFCCF(null, 9); |
1699 |
|
try { |
1710 |
|
* invokeAll(tasks) with > 2 argument throws exception if any task does |
1711 |
|
*/ |
1712 |
|
public void testAbnormalInvokeAll3Singleton() { |
1713 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1713 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1714 |
|
public void realCompute() { |
1715 |
|
CCF f = new LCCF(null, 8); |
1716 |
|
FailingCCF g = new LFCCF(null, 9); |
1729 |
|
* invokeAll(collection) throws exception if any task does |
1730 |
|
*/ |
1731 |
|
public void testAbnormalInvokeAllCollectionSingleton() { |
1732 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1732 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1733 |
|
public void realCompute() { |
1734 |
|
FailingCCF f = new LFCCF(null, 8); |
1735 |
|
CCF g = new LCCF(null, 9); |