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

Comparing jsr166/src/test/tck/ForkJoinPool8Test.java (file contents):
Revision 1.6 by dl, Fri Mar 22 19:02:27 2013 UTC vs.
Revision 1.7 by jsr166, Tue Apr 16 05:49:18 2013 UTC

# Line 980 | Line 980 | public class ForkJoinPool8Test extends J
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());
# Line 996 | Line 996 | public class ForkJoinPool8Test extends J
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();
# Line 1010 | Line 1010 | public class ForkJoinPool8Test extends J
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());
# Line 1025 | Line 1025 | public class ForkJoinPool8Test extends J
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());
# Line 1040 | Line 1040 | public class ForkJoinPool8Test extends J
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());
# Line 1055 | Line 1055 | public class ForkJoinPool8Test extends J
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());
# Line 1071 | Line 1071 | public class ForkJoinPool8Test extends J
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());
# Line 1086 | Line 1086 | public class ForkJoinPool8Test extends J
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 {
# Line 1103 | Line 1103 | public class ForkJoinPool8Test extends J
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();
# Line 1117 | Line 1117 | public class ForkJoinPool8Test extends J
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());
# Line 1135 | Line 1135 | public class ForkJoinPool8Test extends J
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());
# Line 1155 | Line 1155 | public class ForkJoinPool8Test extends J
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());
# Line 1175 | Line 1175 | public class ForkJoinPool8Test extends J
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());
# Line 1190 | Line 1190 | public class ForkJoinPool8Test extends J
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));
# Line 1208 | Line 1208 | public class ForkJoinPool8Test extends J
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));
# Line 1227 | Line 1227 | public class ForkJoinPool8Test extends J
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));
# Line 1246 | Line 1246 | public class ForkJoinPool8Test extends J
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));
# Line 1265 | Line 1265 | public class ForkJoinPool8Test extends J
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));
# Line 1280 | Line 1280 | public class ForkJoinPool8Test extends J
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              }};
# Line 1291 | Line 1291 | public class ForkJoinPool8Test extends J
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              }};
# Line 1302 | Line 1302 | public class ForkJoinPool8Test extends J
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());
# Line 1314 | Line 1314 | public class ForkJoinPool8Test extends J
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());
# Line 1332 | Line 1332 | public class ForkJoinPool8Test extends J
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);
# Line 1349 | Line 1349 | public class ForkJoinPool8Test extends J
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);
# Line 1363 | Line 1363 | public class ForkJoinPool8Test extends J
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);
# Line 1383 | Line 1383 | public class ForkJoinPool8Test extends J
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);
# Line 1407 | Line 1407 | public class ForkJoinPool8Test extends J
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);
# Line 1424 | Line 1424 | public class ForkJoinPool8Test extends J
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);
# Line 1442 | Line 1442 | public class ForkJoinPool8Test extends J
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 {
# Line 1459 | Line 1459 | public class ForkJoinPool8Test extends J
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);
# Line 1478 | Line 1478 | public class ForkJoinPool8Test extends J
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines