980 |
|
* completed tasks; getRawResult returns null. |
981 |
|
*/ |
982 |
|
public void testInvokeCC() { |
983 |
< |
ForkJoinTask a = new CheckedFJTask() { |
983 |
> |
ForkJoinTask a = new CheckedFJTask() { |
984 |
|
public void realCompute() { |
985 |
|
CCF f = new LCCF(null, 8); |
986 |
|
assertNull(f.invoke()); |
996 |
|
* completed tasks |
997 |
|
*/ |
998 |
|
public void testQuietlyInvokeCC() { |
999 |
< |
ForkJoinTask a = new CheckedFJTask() { |
999 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1000 |
|
public void realCompute() { |
1001 |
|
CCF f = new LCCF(null, 8); |
1002 |
|
f.quietlyInvoke(); |
1010 |
|
* join of a forked task returns when task completes |
1011 |
|
*/ |
1012 |
|
public void testForkJoinCC() { |
1013 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1013 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1014 |
|
public void realCompute() { |
1015 |
|
CCF f = new LCCF(null, 8); |
1016 |
|
assertSame(f, f.fork()); |
1025 |
|
* get of a forked task returns when task completes |
1026 |
|
*/ |
1027 |
|
public void testForkGetCC() { |
1028 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1028 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1029 |
|
public void realCompute() throws Exception { |
1030 |
|
CCF f = new LCCF(null, 8); |
1031 |
|
assertSame(f, f.fork()); |
1040 |
|
* timed get of a forked task returns when task completes |
1041 |
|
*/ |
1042 |
|
public void testForkTimedGetCC() { |
1043 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1043 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1044 |
|
public void realCompute() throws Exception { |
1045 |
|
CCF f = new LCCF(null, 8); |
1046 |
|
assertSame(f, f.fork()); |
1055 |
|
* timed get with null time unit throws NPE |
1056 |
|
*/ |
1057 |
|
public void testForkTimedGetNPECC() { |
1058 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1058 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1059 |
|
public void realCompute() throws Exception { |
1060 |
|
CCF f = new LCCF(null, 8); |
1061 |
|
assertSame(f, f.fork()); |
1071 |
|
* quietlyJoin of a forked task returns when task completes |
1072 |
|
*/ |
1073 |
|
public void testForkQuietlyJoinCC() { |
1074 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1074 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1075 |
|
public void realCompute() { |
1076 |
|
CCF f = new LCCF(null, 8); |
1077 |
|
assertSame(f, f.fork()); |
1086 |
|
* invoke task throws exception when task completes abnormally |
1087 |
|
*/ |
1088 |
|
public void testAbnormalInvokeCC() { |
1089 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1089 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1090 |
|
public void realCompute() { |
1091 |
|
FailingCCF f = new LFCCF(null, 8); |
1092 |
|
try { |
1103 |
|
* quietlyInvoke task returns when task completes abnormally |
1104 |
|
*/ |
1105 |
|
public void testAbnormalQuietlyInvokeCC() { |
1106 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1106 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1107 |
|
public void realCompute() { |
1108 |
|
FailingCCF f = new LFCCF(null, 8); |
1109 |
|
f.quietlyInvoke(); |
1117 |
|
* join of a forked task throws exception when task completes abnormally |
1118 |
|
*/ |
1119 |
|
public void testAbnormalForkJoinCC() { |
1120 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1120 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1121 |
|
public void realCompute() { |
1122 |
|
FailingCCF f = new LFCCF(null, 8); |
1123 |
|
assertSame(f, f.fork()); |
1135 |
|
* get of a forked task throws exception when task completes abnormally |
1136 |
|
*/ |
1137 |
|
public void testAbnormalForkGetCC() { |
1138 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1138 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1139 |
|
public void realCompute() throws Exception { |
1140 |
|
FailingCCF f = new LFCCF(null, 8); |
1141 |
|
assertSame(f, f.fork()); |
1155 |
|
* timed get of a forked task throws exception when task completes abnormally |
1156 |
|
*/ |
1157 |
|
public void testAbnormalForkTimedGetCC() { |
1158 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1158 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1159 |
|
public void realCompute() throws Exception { |
1160 |
|
FailingCCF f = new LFCCF(null, 8); |
1161 |
|
assertSame(f, f.fork()); |
1175 |
|
* quietlyJoin of a forked task returns when task completes abnormally |
1176 |
|
*/ |
1177 |
|
public void testAbnormalForkQuietlyJoinCC() { |
1178 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1178 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1179 |
|
public void realCompute() { |
1180 |
|
FailingCCF f = new LFCCF(null, 8); |
1181 |
|
assertSame(f, f.fork()); |
1190 |
|
* invoke task throws exception when task cancelled |
1191 |
|
*/ |
1192 |
|
public void testCancelledInvokeCC() { |
1193 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1193 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1194 |
|
public void realCompute() { |
1195 |
|
CCF f = new LCCF(null, 8); |
1196 |
|
assertTrue(f.cancel(true)); |
1208 |
|
* join of a forked task throws exception when task cancelled |
1209 |
|
*/ |
1210 |
|
public void testCancelledForkJoinCC() { |
1211 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1211 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1212 |
|
public void realCompute() { |
1213 |
|
CCF f = new LCCF(null, 8); |
1214 |
|
assertTrue(f.cancel(true)); |
1227 |
|
* get of a forked task throws exception when task cancelled |
1228 |
|
*/ |
1229 |
|
public void testCancelledForkGetCC() { |
1230 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1230 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1231 |
|
public void realCompute() throws Exception { |
1232 |
|
CCF f = new LCCF(null, 8); |
1233 |
|
assertTrue(f.cancel(true)); |
1246 |
|
* timed get of a forked task throws exception when task cancelled |
1247 |
|
*/ |
1248 |
|
public void testCancelledForkTimedGetCC() throws Exception { |
1249 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1249 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1250 |
|
public void realCompute() throws Exception { |
1251 |
|
CCF f = new LCCF(null, 8); |
1252 |
|
assertTrue(f.cancel(true)); |
1265 |
|
* quietlyJoin of a forked task returns when task cancelled |
1266 |
|
*/ |
1267 |
|
public void testCancelledForkQuietlyJoinCC() { |
1268 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1268 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1269 |
|
public void realCompute() { |
1270 |
|
CCF f = new LCCF(null, 8); |
1271 |
|
assertTrue(f.cancel(true)); |
1280 |
|
* getPool of non-FJ task returns null |
1281 |
|
*/ |
1282 |
|
public void testGetPool2CC() { |
1283 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1283 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1284 |
|
public void realCompute() { |
1285 |
|
assertNull(getPool()); |
1286 |
|
}}; |
1291 |
|
* inForkJoinPool of non-FJ task returns false |
1292 |
|
*/ |
1293 |
|
public void testInForkJoinPool2CC() { |
1294 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1294 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1295 |
|
public void realCompute() { |
1296 |
|
assertFalse(inForkJoinPool()); |
1297 |
|
}}; |
1302 |
|
* setRawResult(null) succeeds |
1303 |
|
*/ |
1304 |
|
public void testSetRawResultCC() { |
1305 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1305 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1306 |
|
public void realCompute() { |
1307 |
|
setRawResult(null); |
1308 |
|
assertNull(getRawResult()); |
1314 |
|
* invoke task throws exception after invoking completeExceptionally |
1315 |
|
*/ |
1316 |
|
public void testCompleteExceptionally2CC() { |
1317 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1317 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1318 |
|
public void realCompute() { |
1319 |
|
CCF f = new LCCF(null, 8); |
1320 |
|
f.completeExceptionally(new FJException()); |
1332 |
|
* invokeAll(t1, t2) invokes all task arguments |
1333 |
|
*/ |
1334 |
|
public void testInvokeAll2CC() { |
1335 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1335 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1336 |
|
public void realCompute() { |
1337 |
|
CCF f = new LCCF(null, 8); |
1338 |
|
CCF g = new LCCF(null, 9); |
1349 |
|
* invokeAll(tasks) with 1 argument invokes task |
1350 |
|
*/ |
1351 |
|
public void testInvokeAll1CC() { |
1352 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1352 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1353 |
|
public void realCompute() { |
1354 |
|
CCF f = new LCCF(null, 8); |
1355 |
|
invokeAll(f); |
1363 |
|
* invokeAll(tasks) with > 2 argument invokes tasks |
1364 |
|
*/ |
1365 |
|
public void testInvokeAll3CC() { |
1366 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1366 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1367 |
|
public void realCompute() { |
1368 |
|
CCF f = new LCCF(null, 8); |
1369 |
|
CCF g = new LCCF(null, 9); |
1383 |
|
* invokeAll(collection) invokes all tasks in the collection |
1384 |
|
*/ |
1385 |
|
public void testInvokeAllCollectionCC() { |
1386 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1386 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1387 |
|
public void realCompute() { |
1388 |
|
CCF f = new LCCF(null, 8); |
1389 |
|
CCF g = new LCCF(null, 9); |
1407 |
|
* invokeAll(tasks) with any null task throws NPE |
1408 |
|
*/ |
1409 |
|
public void testInvokeAllNPECC() { |
1410 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1410 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1411 |
|
public void realCompute() { |
1412 |
|
CCF f = new LCCF(null, 8); |
1413 |
|
CCF g = new LCCF(null, 9); |
1424 |
|
* invokeAll(t1, t2) throw exception if any task does |
1425 |
|
*/ |
1426 |
|
public void testAbnormalInvokeAll2CC() { |
1427 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1427 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1428 |
|
public void realCompute() { |
1429 |
|
CCF f = new LCCF(null, 8); |
1430 |
|
FailingCCF g = new LFCCF(null, 9); |
1442 |
|
* invokeAll(tasks) with 1 argument throws exception if task does |
1443 |
|
*/ |
1444 |
|
public void testAbnormalInvokeAll1CC() { |
1445 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1445 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1446 |
|
public void realCompute() { |
1447 |
|
FailingCCF g = new LFCCF(null, 9); |
1448 |
|
try { |
1459 |
|
* invokeAll(tasks) with > 2 argument throws exception if any task does |
1460 |
|
*/ |
1461 |
|
public void testAbnormalInvokeAll3CC() { |
1462 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1462 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1463 |
|
public void realCompute() { |
1464 |
|
CCF f = new LCCF(null, 8); |
1465 |
|
FailingCCF g = new LFCCF(null, 9); |
1478 |
|
* invokeAll(collection) throws exception if any task does |
1479 |
|
*/ |
1480 |
|
public void testAbnormalInvokeAllCollectionCC() { |
1481 |
< |
ForkJoinTask a = new CheckedFJTask() { |
1481 |
> |
ForkJoinTask a = new CheckedFJTask() { |
1482 |
|
public void realCompute() { |
1483 |
|
FailingCCF f = new LFCCF(null, 8); |
1484 |
|
CCF g = new LCCF(null, 9); |