--- jsr166/src/test/tck/CountedCompleterTest.java 2013/03/21 16:26:43 1.2 +++ jsr166/src/test/tck/CountedCompleterTest.java 2013/06/03 18:20:05 1.7 @@ -32,21 +32,6 @@ public class CountedCompleterTest extend static final int mainPoolSize = Math.max(2, Runtime.getRuntime().availableProcessors()); - /** - * Analog of CheckedRunnable for ForkJoinTasks - */ - public abstract class CheckedFJTask extends RecursiveAction { - protected abstract void realCompute() throws Throwable; - - public final void compute() { - try { - realCompute(); - } catch (Throwable t) { - threadUnexpectedException(t); - } - } - } - private static ForkJoinPool mainPool() { return new ForkJoinPool(mainPoolSize); } @@ -228,7 +213,7 @@ public class CountedCompleterTest extend } /** - * A newly constructed CountedCompleter is not completed; + * A newly constructed CountedCompleter is not completed; * complete() causes completion. */ public void testComplete() { @@ -320,7 +305,7 @@ public class CountedCompleterTest extend CountedCompleter b = new NoopCountedCompleter(a); assertEquals(a, b.getCompleter()); } - + /** * getRoot returns self if no parent, else parent's root */ @@ -330,7 +315,7 @@ public class CountedCompleterTest extend assertEquals(a, a.getRoot()); assertEquals(a, b.getRoot()); } - + /** * tryComplete causes completion if pending count is zero */ @@ -343,7 +328,7 @@ public class CountedCompleterTest extend } /** - * propagateCompletion causes completion without invokein + * propagateCompletion causes completion without invoking * onCompletion if pending count is zero */ public void testPropagateCompletion() { @@ -355,7 +340,7 @@ public class CountedCompleterTest extend } /** - * tryComplete decrments pending count unless zero + * tryComplete decrements pending count unless zero */ public void testTryComplete2() { NoopCountedCompleter a = new NoopCountedCompleter(); @@ -414,9 +399,9 @@ public class CountedCompleterTest extend // Invocation tests use some interdependent task classes // to better test propagation etc - + // Version of Fibonacci with different classes for left vs right forks - static abstract class CCF extends CountedCompleter { + abstract static class CCF extends CountedCompleter { int number; int rnumber; @@ -437,8 +422,8 @@ public class CountedCompleterTest extend f.onCompletion(f); if ((p = f.getCompleter()) != null) p.tryComplete(); - else - f.quietlyComplete(); + else + f.quietlyComplete(); } } @@ -470,7 +455,7 @@ public class CountedCompleterTest extend } // Version of CCF with forced failure in left completions - static abstract class FailingCCF extends CountedCompleter { + abstract static class FailingCCF extends CountedCompleter { int number; int rnumber; @@ -491,8 +476,8 @@ public class CountedCompleterTest extend f.onCompletion(f); if ((p = f.getCompleter()) != null) p.tryComplete(); - else - f.quietlyComplete(); + else + f.quietlyComplete(); } } @@ -517,15 +502,15 @@ public class CountedCompleterTest extend completeExceptionally(new FJException()); } } - + /** * invoke returns when task completes normally. * isCompletedAbnormally and isCancelled return false for normally * completed tasks; getRawResult returns null. */ public void testInvoke() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertNull(f.invoke()); assertEquals(21, f.number); @@ -540,8 +525,8 @@ public class CountedCompleterTest extend * completed tasks */ public void testQuietlyInvoke() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); f.quietlyInvoke(); assertEquals(21, f.number); @@ -554,8 +539,8 @@ public class CountedCompleterTest extend * join of a forked task returns when task completes */ public void testForkJoin() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); assertNull(f.join()); @@ -569,8 +554,8 @@ public class CountedCompleterTest extend * get of a forked task returns when task completes */ public void testForkGet() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); assertNull(f.get()); @@ -584,8 +569,8 @@ public class CountedCompleterTest extend * timed get of a forked task returns when task completes */ public void testForkTimedGet() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); @@ -599,8 +584,8 @@ public class CountedCompleterTest extend * timed get with null time unit throws NPE */ public void testForkTimedGetNPE() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); try { @@ -615,8 +600,8 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes */ public void testForkQuietlyJoin() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); f.quietlyJoin(); @@ -631,8 +616,8 @@ public class CountedCompleterTest extend * getQueuedTaskCount returns 0 when quiescent */ public void testForkHelpQuiesce() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); helpQuiesce(); @@ -647,8 +632,8 @@ public class CountedCompleterTest extend * invoke task throws exception when task completes abnormally */ public void testAbnormalInvoke() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); try { f.invoke(); @@ -664,8 +649,8 @@ public class CountedCompleterTest extend * quietlyInvoke task returns when task completes abnormally */ public void testAbnormalQuietlyInvoke() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); f.quietlyInvoke(); assertTrue(f.getException() instanceof FJException); @@ -678,8 +663,8 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task completes abnormally */ public void testAbnormalForkJoin() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); try { @@ -696,8 +681,8 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkGet() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); try { @@ -716,8 +701,8 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkTimedGet() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); try { @@ -736,8 +721,8 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes abnormally */ public void testAbnormalForkQuietlyJoin() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); f.quietlyJoin(); @@ -751,8 +736,8 @@ public class CountedCompleterTest extend * invoke task throws exception when task cancelled */ public void testCancelledInvoke() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); try { @@ -769,8 +754,8 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task cancelled */ public void testCancelledForkJoin() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -788,8 +773,8 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task cancelled */ public void testCancelledForkGet() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -807,8 +792,8 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task cancelled */ public void testCancelledForkTimedGet() throws Exception { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -826,8 +811,8 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task cancelled */ public void testCancelledForkQuietlyJoin() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -842,8 +827,8 @@ public class CountedCompleterTest extend */ public void testGetPool() { final ForkJoinPool mainPool = mainPool(); - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { assertSame(mainPool, getPool()); }}; testInvokeOnPool(mainPool, a); @@ -853,8 +838,8 @@ public class CountedCompleterTest extend * getPool of non-FJ task returns null */ public void testGetPool2() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { assertNull(getPool()); }}; assertNull(a.invoke()); @@ -864,8 +849,8 @@ public class CountedCompleterTest extend * inForkJoinPool of executing task returns true */ public void testInForkJoinPool() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { assertTrue(inForkJoinPool()); }}; testInvokeOnPool(mainPool(), a); @@ -875,8 +860,8 @@ public class CountedCompleterTest extend * inForkJoinPool of non-FJ task returns false */ public void testInForkJoinPool2() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { assertFalse(inForkJoinPool()); }}; assertNull(a.invoke()); @@ -886,8 +871,8 @@ public class CountedCompleterTest extend * setRawResult(null) succeeds */ public void testSetRawResult() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { setRawResult(null); assertNull(getRawResult()); }}; @@ -898,8 +883,8 @@ public class CountedCompleterTest extend * invoke task throws exception after invoking completeExceptionally */ public void testCompleteExceptionally2() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); f.completeExceptionally(new FJException()); try { @@ -916,8 +901,8 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) invokes all task arguments */ public void testInvokeAll2() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); invokeAll(f, g); @@ -933,8 +918,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument invokes task */ public void testInvokeAll1() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); invokeAll(f); checkCompletedNormally(f); @@ -947,8 +932,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument invokes tasks */ public void testInvokeAll3() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = new LCCF(null, 7); @@ -967,8 +952,8 @@ public class CountedCompleterTest extend * invokeAll(collection) invokes all tasks in the collection */ public void testInvokeAllCollection() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = new LCCF(null, 7); @@ -991,8 +976,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with any null task throws NPE */ public void testInvokeAllNPE() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = null; @@ -1008,8 +993,8 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) throw exception if any task does */ public void testAbnormalInvokeAll2() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); FailingCCF g = new LFCCF(null, 9); try { @@ -1026,8 +1011,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument throws exception if task does */ public void testAbnormalInvokeAll1() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF g = new LFCCF(null, 9); try { invokeAll(g); @@ -1043,8 +1028,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument throws exception if any task does */ public void testAbnormalInvokeAll3() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); FailingCCF g = new LFCCF(null, 9); CCF h = new LCCF(null, 7); @@ -1062,8 +1047,8 @@ public class CountedCompleterTest extend * invokeAll(collection) throws exception if any task does */ public void testAbnormalInvokeAllCollection() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = new LCCF(null, 7); @@ -1086,8 +1071,8 @@ public class CountedCompleterTest extend * and suppresses execution */ public void testTryUnfork() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1105,8 +1090,8 @@ public class CountedCompleterTest extend * there are more tasks than threads */ public void testGetSurplusQueuedTaskCount() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF h = new LCCF(null, 7); assertSame(h, h.fork()); CCF g = new LCCF(null, 9); @@ -1127,8 +1112,8 @@ public class CountedCompleterTest extend * peekNextLocalTask returns most recent unexecuted task. */ public void testPeekNextLocalTask() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1147,8 +1132,8 @@ public class CountedCompleterTest extend * executing it */ public void testPollNextLocalTask() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1166,8 +1151,8 @@ public class CountedCompleterTest extend * pollTask returns an unexecuted task without executing it */ public void testPollTask() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1184,8 +1169,8 @@ public class CountedCompleterTest extend * peekNextLocalTask returns least recent unexecuted task in async mode */ public void testPeekNextLocalTaskAsync() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1205,8 +1190,8 @@ public class CountedCompleterTest extend * executing it, in async mode */ public void testPollNextLocalTaskAsync() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1225,8 +1210,8 @@ public class CountedCompleterTest extend * async mode */ public void testPollTaskAsync() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF g = new LCCF(null, 9); assertSame(g, g.fork()); CCF f = new LCCF(null, 8); @@ -1248,8 +1233,8 @@ public class CountedCompleterTest extend * completed tasks; getRawResult returns null. */ public void testInvokeSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertNull(f.invoke()); assertEquals(21, f.number); @@ -1264,8 +1249,8 @@ public class CountedCompleterTest extend * completed tasks */ public void testQuietlyInvokeSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); f.quietlyInvoke(); assertEquals(21, f.number); @@ -1278,8 +1263,8 @@ public class CountedCompleterTest extend * join of a forked task returns when task completes */ public void testForkJoinSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); assertNull(f.join()); @@ -1293,8 +1278,8 @@ public class CountedCompleterTest extend * get of a forked task returns when task completes */ public void testForkGetSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); assertNull(f.get()); @@ -1308,8 +1293,8 @@ public class CountedCompleterTest extend * timed get of a forked task returns when task completes */ public void testForkTimedGetSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); @@ -1323,8 +1308,8 @@ public class CountedCompleterTest extend * timed get with null time unit throws NPE */ public void testForkTimedGetNPESingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); try { @@ -1339,8 +1324,8 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes */ public void testForkQuietlyJoinSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); f.quietlyJoin(); @@ -1355,8 +1340,8 @@ public class CountedCompleterTest extend * getQueuedTaskCount returns 0 when quiescent */ public void testForkHelpQuiesceSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertSame(f, f.fork()); helpQuiesce(); @@ -1371,8 +1356,8 @@ public class CountedCompleterTest extend * invoke task throws exception when task completes abnormally */ public void testAbnormalInvokeSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); try { f.invoke(); @@ -1388,8 +1373,8 @@ public class CountedCompleterTest extend * quietlyInvoke task returns when task completes abnormally */ public void testAbnormalQuietlyInvokeSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); f.quietlyInvoke(); assertTrue(f.getException() instanceof FJException); @@ -1402,8 +1387,8 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task completes abnormally */ public void testAbnormalForkJoinSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); try { @@ -1420,8 +1405,8 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkGetSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); try { @@ -1440,8 +1425,8 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkTimedGetSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); try { @@ -1460,8 +1445,8 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes abnormally */ public void testAbnormalForkQuietlyJoinSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); assertSame(f, f.fork()); f.quietlyJoin(); @@ -1475,8 +1460,8 @@ public class CountedCompleterTest extend * invoke task throws exception when task cancelled */ public void testCancelledInvokeSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); try { @@ -1493,8 +1478,8 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task cancelled */ public void testCancelledForkJoinSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -1512,8 +1497,8 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task cancelled */ public void testCancelledForkGetSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -1531,8 +1516,8 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task cancelled */ public void testCancelledForkTimedGetSingleton() throws Exception { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() throws Exception { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() throws Exception { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -1550,8 +1535,8 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task cancelled */ public void testCancelledForkQuietlyJoinSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); assertTrue(f.cancel(true)); assertSame(f, f.fork()); @@ -1565,8 +1550,8 @@ public class CountedCompleterTest extend * invoke task throws exception after invoking completeExceptionally */ public void testCompleteExceptionallySingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); f.completeExceptionally(new FJException()); try { @@ -1583,8 +1568,8 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) invokes all task arguments */ public void testInvokeAll2Singleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); invokeAll(f, g); @@ -1600,8 +1585,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument invokes task */ public void testInvokeAll1Singleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); invokeAll(f); checkCompletedNormally(f); @@ -1614,8 +1599,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument invokes tasks */ public void testInvokeAll3Singleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = new LCCF(null, 7); @@ -1634,8 +1619,8 @@ public class CountedCompleterTest extend * invokeAll(collection) invokes all tasks in the collection */ public void testInvokeAllCollectionSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = new LCCF(null, 7); @@ -1658,8 +1643,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with any null task throws NPE */ public void testInvokeAllNPESingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = null; @@ -1675,8 +1660,8 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) throw exception if any task does */ public void testAbnormalInvokeAll2Singleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); FailingCCF g = new LFCCF(null, 9); try { @@ -1693,8 +1678,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument throws exception if task does */ public void testAbnormalInvokeAll1Singleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF g = new LFCCF(null, 9); try { invokeAll(g); @@ -1710,8 +1695,8 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument throws exception if any task does */ public void testAbnormalInvokeAll3Singleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { CCF f = new LCCF(null, 8); FailingCCF g = new LFCCF(null, 9); CCF h = new LCCF(null, 7); @@ -1729,8 +1714,8 @@ public class CountedCompleterTest extend * invokeAll(collection) throws exception if any task does */ public void testAbnormalInvokeAllCollectionSingleton() { - ForkJoinTask a = new CheckedFJTask() { - public void realCompute() { + ForkJoinTask a = new CheckedRecursiveAction() { + protected void realCompute() { FailingCCF f = new LFCCF(null, 8); CCF g = new LCCF(null, 9); CCF h = new LCCF(null, 7);