9 |
|
import static java.util.concurrent.TimeUnit.SECONDS; |
10 |
|
|
11 |
|
import java.util.ArrayList; |
12 |
+ |
import java.util.Collection; |
13 |
+ |
import java.util.Collections; |
14 |
|
import java.util.HashSet; |
15 |
|
import java.util.List; |
16 |
|
import java.util.concurrent.BlockingQueue; |
27 |
|
import java.util.concurrent.ScheduledFuture; |
28 |
|
import java.util.concurrent.ScheduledThreadPoolExecutor; |
29 |
|
import java.util.concurrent.ThreadFactory; |
30 |
+ |
import java.util.concurrent.ThreadLocalRandom; |
31 |
|
import java.util.concurrent.ThreadPoolExecutor; |
32 |
|
import java.util.concurrent.TimeoutException; |
33 |
|
import java.util.concurrent.TimeUnit; |
34 |
|
import java.util.concurrent.atomic.AtomicBoolean; |
35 |
|
import java.util.concurrent.atomic.AtomicInteger; |
36 |
|
import java.util.concurrent.atomic.AtomicLong; |
37 |
+ |
import java.util.stream.Stream; |
38 |
|
|
39 |
|
import junit.framework.Test; |
40 |
|
import junit.framework.TestSuite; |
299 |
|
final CustomExecutor p = new CustomExecutor(1); |
300 |
|
try (PoolCleaner cleaner = cleaner(p)) { |
301 |
|
try { |
302 |
< |
TrackedCallable callable = null; |
303 |
< |
Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); |
302 |
> |
Future f = p.schedule((Callable)null, |
303 |
> |
randomTimeout(), randomTimeUnit()); |
304 |
|
shouldThrow(); |
305 |
|
} catch (NullPointerException success) {} |
306 |
|
} |
315 |
|
try { |
316 |
|
p.shutdown(); |
317 |
|
p.schedule(new NoOpRunnable(), |
318 |
< |
MEDIUM_DELAY_MS, MILLISECONDS); |
318 |
> |
randomTimeout(), randomTimeUnit()); |
319 |
|
shouldThrow(); |
320 |
|
} catch (RejectedExecutionException success) { |
321 |
|
} catch (SecurityException ok) {} |
331 |
|
try { |
332 |
|
p.shutdown(); |
333 |
|
p.schedule(new NoOpCallable(), |
334 |
< |
MEDIUM_DELAY_MS, MILLISECONDS); |
334 |
> |
randomTimeout(), randomTimeUnit()); |
335 |
|
shouldThrow(); |
336 |
|
} catch (RejectedExecutionException success) { |
337 |
|
} catch (SecurityException ok) {} |
347 |
|
try { |
348 |
|
p.shutdown(); |
349 |
|
p.schedule(new NoOpCallable(), |
350 |
< |
MEDIUM_DELAY_MS, MILLISECONDS); |
350 |
> |
randomTimeout(), randomTimeUnit()); |
351 |
|
shouldThrow(); |
352 |
|
} catch (RejectedExecutionException success) { |
353 |
|
} catch (SecurityException ok) {} |
790 |
|
* - setContinueExistingPeriodicTasksAfterShutdownPolicy |
791 |
|
*/ |
792 |
|
public void testShutdown_cancellation() throws Exception { |
793 |
< |
Boolean[] allBooleans = { null, Boolean.FALSE, Boolean.TRUE }; |
790 |
< |
for (Boolean policy : allBooleans) |
791 |
< |
{ |
792 |
< |
final int poolSize = 2; |
793 |
> |
final int poolSize = 4; |
794 |
|
final CustomExecutor p = new CustomExecutor(poolSize); |
795 |
< |
final boolean effectiveDelayedPolicy = (policy != Boolean.FALSE); |
796 |
< |
final boolean effectivePeriodicPolicy = (policy == Boolean.TRUE); |
797 |
< |
final boolean effectiveRemovePolicy = (policy == Boolean.TRUE); |
798 |
< |
if (policy != null) { |
799 |
< |
p.setExecuteExistingDelayedTasksAfterShutdownPolicy(policy); |
800 |
< |
p.setContinueExistingPeriodicTasksAfterShutdownPolicy(policy); |
801 |
< |
p.setRemoveOnCancelPolicy(policy); |
802 |
< |
} |
795 |
> |
final BlockingQueue<Runnable> q = p.getQueue(); |
796 |
> |
final ThreadLocalRandom rnd = ThreadLocalRandom.current(); |
797 |
> |
final long delay = rnd.nextInt(2); |
798 |
> |
final int rounds = rnd.nextInt(1, 3); |
799 |
> |
final boolean effectiveDelayedPolicy; |
800 |
> |
final boolean effectivePeriodicPolicy; |
801 |
> |
final boolean effectiveRemovePolicy; |
802 |
> |
|
803 |
> |
if (rnd.nextBoolean()) |
804 |
> |
p.setExecuteExistingDelayedTasksAfterShutdownPolicy( |
805 |
> |
effectiveDelayedPolicy = rnd.nextBoolean()); |
806 |
> |
else |
807 |
> |
effectiveDelayedPolicy = true; |
808 |
|
assertEquals(effectiveDelayedPolicy, |
809 |
|
p.getExecuteExistingDelayedTasksAfterShutdownPolicy()); |
810 |
+ |
|
811 |
+ |
if (rnd.nextBoolean()) |
812 |
+ |
p.setContinueExistingPeriodicTasksAfterShutdownPolicy( |
813 |
+ |
effectivePeriodicPolicy = rnd.nextBoolean()); |
814 |
+ |
else |
815 |
+ |
effectivePeriodicPolicy = false; |
816 |
|
assertEquals(effectivePeriodicPolicy, |
817 |
|
p.getContinueExistingPeriodicTasksAfterShutdownPolicy()); |
818 |
+ |
|
819 |
+ |
if (rnd.nextBoolean()) |
820 |
+ |
p.setRemoveOnCancelPolicy( |
821 |
+ |
effectiveRemovePolicy = rnd.nextBoolean()); |
822 |
+ |
else |
823 |
+ |
effectiveRemovePolicy = false; |
824 |
|
assertEquals(effectiveRemovePolicy, |
825 |
|
p.getRemoveOnCancelPolicy()); |
826 |
< |
// Strategy: Wedge the pool with poolSize "blocker" threads |
826 |
> |
|
827 |
> |
final boolean periodicTasksContinue = effectivePeriodicPolicy && rnd.nextBoolean(); |
828 |
> |
|
829 |
> |
// Strategy: Wedge the pool with one wave of "blocker" tasks, |
830 |
> |
// then add a second wave that waits in the queue until unblocked. |
831 |
|
final AtomicInteger ran = new AtomicInteger(0); |
832 |
|
final CountDownLatch poolBlocked = new CountDownLatch(poolSize); |
833 |
|
final CountDownLatch unblock = new CountDownLatch(1); |
834 |
< |
final CountDownLatch periodicLatch1 = new CountDownLatch(2); |
835 |
< |
final CountDownLatch periodicLatch2 = new CountDownLatch(2); |
836 |
< |
Runnable task = new CheckedRunnable() { public void realRun() |
837 |
< |
throws InterruptedException { |
838 |
< |
poolBlocked.countDown(); |
839 |
< |
await(unblock); |
840 |
< |
ran.getAndIncrement(); |
841 |
< |
}}; |
842 |
< |
List<Future<?>> blockers = new ArrayList<>(); |
843 |
< |
List<Future<?>> periodics = new ArrayList<>(); |
844 |
< |
List<Future<?>> delayeds = new ArrayList<>(); |
845 |
< |
for (int i = 0; i < poolSize; i++) |
846 |
< |
blockers.add(p.submit(task)); |
834 |
> |
final RuntimeException exception = new RuntimeException(); |
835 |
> |
|
836 |
> |
class Task implements Runnable { |
837 |
> |
public void run() { |
838 |
> |
try { |
839 |
> |
ran.getAndIncrement(); |
840 |
> |
poolBlocked.countDown(); |
841 |
> |
await(unblock); |
842 |
> |
} catch (Throwable fail) { threadUnexpectedException(fail); } |
843 |
> |
} |
844 |
> |
} |
845 |
> |
|
846 |
> |
class PeriodicTask extends Task { |
847 |
> |
PeriodicTask(int rounds) { this.rounds = rounds; } |
848 |
> |
int rounds; |
849 |
> |
public void run() { |
850 |
> |
if (--rounds == 0) super.run(); |
851 |
> |
// throw exception to surely terminate this periodic task, |
852 |
> |
// but in a separate execution and in a detectable way. |
853 |
> |
if (rounds == -1) throw exception; |
854 |
> |
} |
855 |
> |
} |
856 |
> |
|
857 |
> |
Runnable task = new Task(); |
858 |
> |
|
859 |
> |
List<Future<?>> immediates = new ArrayList<>(); |
860 |
> |
List<Future<?>> delayeds = new ArrayList<>(); |
861 |
> |
List<Future<?>> periodics = new ArrayList<>(); |
862 |
> |
|
863 |
> |
immediates.add(p.submit(task)); |
864 |
> |
delayeds.add(p.schedule(task, delay, MILLISECONDS)); |
865 |
> |
periodics.add(p.scheduleAtFixedRate( |
866 |
> |
new PeriodicTask(rounds), delay, 1, MILLISECONDS)); |
867 |
> |
periodics.add(p.scheduleWithFixedDelay( |
868 |
> |
new PeriodicTask(rounds), delay, 1, MILLISECONDS)); |
869 |
> |
|
870 |
|
await(poolBlocked); |
871 |
|
|
872 |
< |
periodics.add(p.scheduleAtFixedRate(countDowner(periodicLatch1), |
873 |
< |
1, 1, MILLISECONDS)); |
874 |
< |
periodics.add(p.scheduleWithFixedDelay(countDowner(periodicLatch2), |
875 |
< |
1, 1, MILLISECONDS)); |
876 |
< |
delayeds.add(p.schedule(task, 1, MILLISECONDS)); |
872 |
> |
assertEquals(poolSize, ran.get()); |
873 |
> |
assertEquals(poolSize, p.getActiveCount()); |
874 |
> |
assertTrue(q.isEmpty()); |
875 |
> |
|
876 |
> |
// Add second wave of tasks. |
877 |
> |
immediates.add(p.submit(task)); |
878 |
> |
delayeds.add(p.schedule(task, effectiveDelayedPolicy ? delay : LONG_DELAY_MS, MILLISECONDS)); |
879 |
> |
periodics.add(p.scheduleAtFixedRate( |
880 |
> |
new PeriodicTask(rounds), delay, 1, MILLISECONDS)); |
881 |
> |
periodics.add(p.scheduleWithFixedDelay( |
882 |
> |
new PeriodicTask(rounds), delay, 1, MILLISECONDS)); |
883 |
> |
|
884 |
> |
assertEquals(poolSize, q.size()); |
885 |
> |
assertEquals(poolSize, ran.get()); |
886 |
> |
|
887 |
> |
immediates.forEach( |
888 |
> |
f -> assertTrue(((ScheduledFuture)f).getDelay(NANOSECONDS) <= 0L)); |
889 |
> |
|
890 |
> |
Stream.of(immediates, delayeds, periodics).flatMap(c -> c.stream()) |
891 |
> |
.forEach(f -> assertFalse(f.isDone())); |
892 |
|
|
833 |
– |
assertTrue(p.getQueue().containsAll(periodics)); |
834 |
– |
assertTrue(p.getQueue().containsAll(delayeds)); |
893 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
894 |
|
assertTrue(p.isShutdown()); |
895 |
+ |
assertTrue(p.isTerminating()); |
896 |
|
assertFalse(p.isTerminated()); |
897 |
< |
for (Future<?> periodic : periodics) { |
898 |
< |
assertTrue(effectivePeriodicPolicy ^ periodic.isCancelled()); |
899 |
< |
assertTrue(effectivePeriodicPolicy ^ periodic.isDone()); |
900 |
< |
} |
901 |
< |
for (Future<?> delayed : delayeds) { |
902 |
< |
assertTrue(effectiveDelayedPolicy ^ delayed.isCancelled()); |
903 |
< |
assertTrue(effectiveDelayedPolicy ^ delayed.isDone()); |
904 |
< |
} |
905 |
< |
if (testImplementationDetails) { |
906 |
< |
assertEquals(effectivePeriodicPolicy, |
907 |
< |
p.getQueue().containsAll(periodics)); |
908 |
< |
assertEquals(effectiveDelayedPolicy, |
909 |
< |
p.getQueue().containsAll(delayeds)); |
910 |
< |
} |
911 |
< |
// Release all pool threads |
912 |
< |
unblock.countDown(); |
913 |
< |
|
914 |
< |
for (Future<?> delayed : delayeds) { |
915 |
< |
if (effectiveDelayedPolicy) { |
916 |
< |
assertNull(delayed.get()); |
917 |
< |
} |
918 |
< |
} |
919 |
< |
if (effectivePeriodicPolicy) { |
920 |
< |
await(periodicLatch1); |
921 |
< |
await(periodicLatch2); |
922 |
< |
for (Future<?> periodic : periodics) { |
923 |
< |
assertTrue(periodic.cancel(false)); |
924 |
< |
assertTrue(periodic.isCancelled()); |
925 |
< |
assertTrue(periodic.isDone()); |
926 |
< |
} |
897 |
> |
|
898 |
> |
if (rnd.nextBoolean()) |
899 |
> |
assertThrows( |
900 |
> |
RejectedExecutionException.class, |
901 |
> |
() -> p.submit(task), |
902 |
> |
() -> p.schedule(task, 1, SECONDS), |
903 |
> |
() -> p.scheduleAtFixedRate( |
904 |
> |
new PeriodicTask(1), 1, 1, SECONDS), |
905 |
> |
() -> p.scheduleWithFixedDelay( |
906 |
> |
new PeriodicTask(2), 1, 1, SECONDS)); |
907 |
> |
|
908 |
> |
assertTrue(q.contains(immediates.get(1))); |
909 |
> |
assertTrue(!effectiveDelayedPolicy |
910 |
> |
^ q.contains(delayeds.get(1))); |
911 |
> |
assertTrue(!effectivePeriodicPolicy |
912 |
> |
^ q.containsAll(periodics.subList(2, 4))); |
913 |
> |
|
914 |
> |
immediates.forEach(f -> assertFalse(f.isDone())); |
915 |
> |
|
916 |
> |
assertFalse(delayeds.get(0).isDone()); |
917 |
> |
if (effectiveDelayedPolicy) |
918 |
> |
assertFalse(delayeds.get(1).isDone()); |
919 |
> |
else |
920 |
> |
assertTrue(delayeds.get(1).isCancelled()); |
921 |
> |
|
922 |
> |
if (effectivePeriodicPolicy) |
923 |
> |
periodics.forEach( |
924 |
> |
f -> { |
925 |
> |
assertFalse(f.isDone()); |
926 |
> |
if (!periodicTasksContinue) { |
927 |
> |
assertTrue(f.cancel(false)); |
928 |
> |
assertTrue(f.isCancelled()); |
929 |
> |
} |
930 |
> |
}); |
931 |
> |
else { |
932 |
> |
periodics.subList(0, 2).forEach(f -> assertFalse(f.isDone())); |
933 |
> |
periodics.subList(2, 4).forEach(f -> assertTrue(f.isCancelled())); |
934 |
|
} |
935 |
+ |
|
936 |
+ |
unblock.countDown(); // Release all pool threads |
937 |
+ |
|
938 |
|
assertTrue(p.awaitTermination(LONG_DELAY_MS, MILLISECONDS)); |
939 |
+ |
assertFalse(p.isTerminating()); |
940 |
|
assertTrue(p.isTerminated()); |
941 |
< |
assertEquals(2 + (effectiveDelayedPolicy ? 1 : 0), ran.get()); |
942 |
< |
}} |
941 |
> |
|
942 |
> |
assertTrue(q.isEmpty()); |
943 |
> |
|
944 |
> |
Stream.of(immediates, delayeds, periodics).flatMap(c -> c.stream()) |
945 |
> |
.forEach(f -> assertTrue(f.isDone())); |
946 |
> |
|
947 |
> |
for (Future<?> f : immediates) assertNull(f.get()); |
948 |
> |
|
949 |
> |
assertNull(delayeds.get(0).get()); |
950 |
> |
if (effectiveDelayedPolicy) |
951 |
> |
assertNull(delayeds.get(1).get()); |
952 |
> |
else |
953 |
> |
assertTrue(delayeds.get(1).isCancelled()); |
954 |
> |
|
955 |
> |
if (periodicTasksContinue) |
956 |
> |
periodics.forEach( |
957 |
> |
f -> { |
958 |
> |
try { f.get(); } |
959 |
> |
catch (ExecutionException success) { |
960 |
> |
assertSame(exception, success.getCause()); |
961 |
> |
} |
962 |
> |
catch (Throwable fail) { threadUnexpectedException(fail); } |
963 |
> |
}); |
964 |
> |
else |
965 |
> |
periodics.forEach(f -> assertTrue(f.isCancelled())); |
966 |
> |
|
967 |
> |
assertEquals(poolSize + 1 |
968 |
> |
+ (effectiveDelayedPolicy ? 1 : 0) |
969 |
> |
+ (periodicTasksContinue ? 2 : 0), |
970 |
> |
ran.get()); |
971 |
> |
} |
972 |
|
|
973 |
|
/** |
974 |
|
* completed submit of callable returns result |
1020 |
|
} |
1021 |
|
|
1022 |
|
/** |
1023 |
< |
* invokeAny(empty collection) throws IAE |
1023 |
> |
* invokeAny(empty collection) throws IllegalArgumentException |
1024 |
|
*/ |
1025 |
|
public void testInvokeAny2() throws Exception { |
1026 |
|
final ExecutorService e = new CustomExecutor(2); |
1095 |
|
} |
1096 |
|
|
1097 |
|
/** |
1098 |
< |
* invokeAll(empty collection) returns empty collection |
1098 |
> |
* invokeAll(empty collection) returns empty list |
1099 |
|
*/ |
1100 |
|
public void testInvokeAll2() throws Exception { |
1101 |
|
final ExecutorService e = new CustomExecutor(2); |
1102 |
+ |
final Collection<Callable<String>> emptyCollection |
1103 |
+ |
= Collections.emptyList(); |
1104 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1105 |
< |
List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); |
1105 |
> |
List<Future<String>> r = e.invokeAll(emptyCollection); |
1106 |
|
assertTrue(r.isEmpty()); |
1107 |
|
} |
1108 |
|
} |
1165 |
|
final ExecutorService e = new CustomExecutor(2); |
1166 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1167 |
|
try { |
1168 |
< |
e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS); |
1168 |
> |
e.invokeAny(null, randomTimeout(), randomTimeUnit()); |
1169 |
|
shouldThrow(); |
1170 |
|
} catch (NullPointerException success) {} |
1171 |
|
} |
1180 |
|
List<Callable<String>> l = new ArrayList<>(); |
1181 |
|
l.add(new StringTask()); |
1182 |
|
try { |
1183 |
< |
e.invokeAny(l, MEDIUM_DELAY_MS, null); |
1183 |
> |
e.invokeAny(l, randomTimeout(), null); |
1184 |
|
shouldThrow(); |
1185 |
|
} catch (NullPointerException success) {} |
1186 |
|
} |
1187 |
|
} |
1188 |
|
|
1189 |
|
/** |
1190 |
< |
* timed invokeAny(empty collection) throws IAE |
1190 |
> |
* timed invokeAny(empty collection) throws IllegalArgumentException |
1191 |
|
*/ |
1192 |
|
public void testTimedInvokeAny2() throws Exception { |
1193 |
|
final ExecutorService e = new CustomExecutor(2); |
1194 |
+ |
final Collection<Callable<String>> emptyCollection |
1195 |
+ |
= Collections.emptyList(); |
1196 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1197 |
|
try { |
1198 |
< |
e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS); |
1198 |
> |
e.invokeAny(emptyCollection, randomTimeout(), randomTimeUnit()); |
1199 |
|
shouldThrow(); |
1200 |
|
} catch (IllegalArgumentException success) {} |
1201 |
|
} |
1212 |
|
l.add(latchAwaitingStringTask(latch)); |
1213 |
|
l.add(null); |
1214 |
|
try { |
1215 |
< |
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
1215 |
> |
e.invokeAny(l, randomTimeout(), randomTimeUnit()); |
1216 |
|
shouldThrow(); |
1217 |
|
} catch (NullPointerException success) {} |
1218 |
|
latch.countDown(); |
1255 |
|
} |
1256 |
|
|
1257 |
|
/** |
1258 |
< |
* timed invokeAll(null) throws NPE |
1258 |
> |
* timed invokeAll(null) throws NullPointerException |
1259 |
|
*/ |
1260 |
|
public void testTimedInvokeAll1() throws Exception { |
1261 |
|
final ExecutorService e = new CustomExecutor(2); |
1262 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1263 |
|
try { |
1264 |
< |
e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS); |
1264 |
> |
e.invokeAll(null, randomTimeout(), randomTimeUnit()); |
1265 |
|
shouldThrow(); |
1266 |
|
} catch (NullPointerException success) {} |
1267 |
|
} |
1268 |
|
} |
1269 |
|
|
1270 |
|
/** |
1271 |
< |
* timed invokeAll(,,null) throws NPE |
1271 |
> |
* timed invokeAll(,,null) throws NullPointerException |
1272 |
|
*/ |
1273 |
|
public void testTimedInvokeAllNullTimeUnit() throws Exception { |
1274 |
|
final ExecutorService e = new CustomExecutor(2); |
1276 |
|
List<Callable<String>> l = new ArrayList<>(); |
1277 |
|
l.add(new StringTask()); |
1278 |
|
try { |
1279 |
< |
e.invokeAll(l, MEDIUM_DELAY_MS, null); |
1279 |
> |
e.invokeAll(l, randomTimeout(), null); |
1280 |
|
shouldThrow(); |
1281 |
|
} catch (NullPointerException success) {} |
1282 |
|
} |
1283 |
|
} |
1284 |
|
|
1285 |
|
/** |
1286 |
< |
* timed invokeAll(empty collection) returns empty collection |
1286 |
> |
* timed invokeAll(empty collection) returns empty list |
1287 |
|
*/ |
1288 |
|
public void testTimedInvokeAll2() throws Exception { |
1289 |
|
final ExecutorService e = new CustomExecutor(2); |
1290 |
+ |
final Collection<Callable<String>> emptyCollection |
1291 |
+ |
= Collections.emptyList(); |
1292 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1293 |
< |
List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS); |
1293 |
> |
List<Future<String>> r = |
1294 |
> |
e.invokeAll(emptyCollection, randomTimeout(), randomTimeUnit()); |
1295 |
|
assertTrue(r.isEmpty()); |
1296 |
|
} |
1297 |
|
} |
1306 |
|
l.add(new StringTask()); |
1307 |
|
l.add(null); |
1308 |
|
try { |
1309 |
< |
e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
1309 |
> |
e.invokeAll(l, randomTimeout(), randomTimeUnit()); |
1310 |
|
shouldThrow(); |
1311 |
|
} catch (NullPointerException success) {} |
1312 |
|
} |
1317 |
|
*/ |
1318 |
|
public void testTimedInvokeAll4() throws Exception { |
1319 |
|
final ExecutorService e = new CustomExecutor(2); |
1320 |
+ |
final Collection<Callable<String>> c = new ArrayList<>(); |
1321 |
+ |
c.add(new NPETask()); |
1322 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1215 |
– |
List<Callable<String>> l = new ArrayList<>(); |
1216 |
– |
l.add(new NPETask()); |
1323 |
|
List<Future<String>> futures = |
1324 |
< |
e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); |
1324 |
> |
e.invokeAll(c, LONG_DELAY_MS, MILLISECONDS); |
1325 |
|
assertEquals(1, futures.size()); |
1326 |
|
try { |
1327 |
|
futures.get(0).get(); |