Home
last modified time | relevance | path

Searched refs:Callable (Results 1 – 25 of 57) sorted by relevance

123

/libcore/luni/src/test/java/libcore/java/lang/
DLambdaImplementationTest.java35 import java.util.concurrent.Callable;
42 Callable<String> r1 = () -> "Hello World"; in testNonCapturingLambda()
44 assertLambdaImplementsInterfaces(r1, Callable.class); in testNonCapturingLambda()
45 assertLambdaMethodCharacteristics(r1, Callable.class); in testNonCapturingLambda()
49 List<Callable<String>> callables = new ArrayList<>(); in testNonCapturingLambda()
85 Callable<String> r1 = LambdaImplementationTest::staticMethod; in testStaticMethodReferenceLambda()
87 assertLambdaImplementsInterfaces(r1, Callable.class); in testStaticMethodReferenceLambda()
88 assertLambdaMethodCharacteristics(r1, Callable.class); in testStaticMethodReferenceLambda()
93 List<Callable<String>> callables = new ArrayList<>(); in testStaticMethodReferenceLambda()
104 Callable<String> r1 = o::toString; in testObjectMethodReferenceLambda()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DAbstractExecutorServiceTest.java20 import java.util.concurrent.Callable;
189 e.submit((Callable) null); in testSubmitNullCallable()
200 final Callable<Void> awaiter = new CheckedCallable<Void>() { in testInterruptedSubmit()
232 Callable c = new Callable() { in testSubmitEE()
263 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
275 List<Callable<Long>> l = new ArrayList<Callable<Long>>(); in testInvokeAny3()
276 l.add(new Callable<Long>() { in testInvokeAny3()
292 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny4()
309 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny5()
336 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
[all …]
DForkJoinPoolTest.java17 import java.util.concurrent.Callable;
485 final Callable callable = Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction()
503 final Callable callable = in testSubmitPrivilegedExceptionAction()
522 final Callable callable = in testSubmitFailedPrivilegedExceptionAction()
562 Future<String> future = e.submit((Callable) null); in testSubmitNullCallable()
574 final Callable<Void> awaiter = new CheckedCallable<Void>() { in testInterruptedSubmit()
602 p.submit(new Callable() { in testSubmitEE()
632 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
644 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny3()
660 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny4()
[all …]
DExecutorCompletionServiceTest.java14 import java.util.concurrent.Callable;
67 Callable c = null; in testSubmitNPE()
97 Callable c = new StringTask(); in testTake()
111 Callable c = new StringTask(); in testTake2()
126 Callable c = new StringTask(); in testPoll1()
149 Callable c = new StringTask(); in testPoll2()
164 MyCallableFuture(Callable<V> c) { super(c); } in testNewTaskForCallable()
171 protected <T> RunnableFuture<T> newTaskFor(Callable<T> c) { in testNewTaskForCallable()
178 Callable<String> c = new StringTask(); in testNewTaskForCallable()
DScheduledExecutorSubclassTest.java17 import java.util.concurrent.Callable;
88 …protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> c, RunnableScheduledFuture<V> ta… in decorateTask()
128 Callable task = new CheckedCallable<Boolean>() { in testSchedule1()
936 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
949 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny3()
966 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny4()
983 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny5()
1010 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
1021 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAll3()
1037 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAll4()
[all …]
DScheduledExecutorTest.java19 import java.util.concurrent.Callable;
71 Callable task = new CheckedCallable<Boolean>() { in testSchedule1()
885 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
898 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny3()
915 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny4()
932 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny5()
959 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
970 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAll3()
986 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAll4()
1005 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAll5()
[all …]
DThreadPoolExecutorSubclassTest.java18 import java.util.concurrent.Callable;
54 final Callable<V> callable;
62 CustomTask(Callable<V> c) { in CustomTask()
68 callable = new Callable<V>() { in CustomTask()
153 protected <V> RunnableFuture<V> newTaskFor(Callable<V> c) { in newTaskFor()
669 Callable task = new CheckedCallable<Boolean>() { in testGetQueue()
735 Callable task = new CheckedCallable<Boolean>() { in testPurge()
1498 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
1514 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny3()
1534 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny4()
[all …]
DThreadPoolExecutorTest.java19 import java.util.concurrent.Callable;
554 Callable task = new CheckedCallable<Boolean>() { in testGetQueue()
620 Callable task = new CheckedCallable<Boolean>() { in testPurge()
1039 Callable task = new CheckedCallable<Boolean>() { in testInterruptedSubmit()
1505 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
1521 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny3()
1541 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny4()
1561 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAny5()
1594 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
1608 List<Callable<String>> l = new ArrayList<Callable<String>>(); in testInvokeAll3()
[all …]
DExecutorsTest.java20 import java.util.concurrent.Callable;
400 class CheckCCL implements Callable<Object> {
453 Callable task = Executors.privilegedCallable(new CheckCCL()); in testPrivilegedCallableWithNoPrivs()
532 Callable c = Executors.callable(new NoOpRunnable()); in testCallable1()
540 Callable c = Executors.callable(new NoOpRunnable(), one); in testCallable2()
548 Callable c = Executors.callable(new PrivilegedAction() { in testCallable3()
557 Callable c = Executors.callable(new PrivilegedExceptionAction() { in testCallable4()
567 Callable c = Executors.callable((Runnable) null); in testCallableNPE1()
577 Callable c = Executors.callable((Runnable) null, one); in testCallableNPE2()
587 Callable c = Executors.callable((PrivilegedAction) null); in testCallableNPE3()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DExecutors.java381 public static <T> Callable<T> callable(Runnable task, T result) { in callable()
394 public static Callable<Object> callable(Runnable task) { in callable()
407 public static Callable<Object> callable(final PrivilegedAction<?> action) { in callable()
410 return new Callable<Object>() { in callable()
422 public static Callable<Object> callable(final PrivilegedExceptionAction<?> action) {
425 return new Callable<Object>() {
433 public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
443 public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) {
454 private static final class RunnableAdapter<T> implements Callable<T> {
470 private static final class PrivilegedCallable<T> implements Callable<T> {
[all …]
DExecutorService.java226 <T> Future<T> submit(Callable<T> task); in submit()
277 <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) in invokeAll()
308 <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, in invokeAll()
331 <T> T invokeAny(Collection<? extends Callable<T>> tasks) in invokeAny()
357 <T> T invokeAny(Collection<? extends Callable<T>> tasks, in invokeAny()
DAbstractExecutorService.java107 protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { in newTaskFor()
137 public <T> Future<T> submit(Callable<T> task) { in submit()
147 private <T> T doInvokeAny(Collection<? extends Callable<T>> tasks, in doInvokeAny()
170 Iterator<? extends Callable<T>> it = tasks.iterator(); in doInvokeAny()
217 public <T> T invokeAny(Collection<? extends Callable<T>> tasks) in invokeAny()
227 public <T> T invokeAny(Collection<? extends Callable<T>> tasks, in invokeAny()
233 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) in invokeAll()
239 for (Callable<T> t : tasks) { in invokeAll()
259 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, in invokeAll()
269 for (Callable<T> t : tasks) in invokeAll()
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/
DExecutors.java120 public static <T> java.util.concurrent.Callable<T> callable(java.lang.Runnable task, T result) { in callable()
124 public static java.util.concurrent.Callable<java.lang.Object> callable( in callable()
129 public static java.util.concurrent.Callable<java.lang.Object> callable( in callable()
134 public static java.util.concurrent.Callable<java.lang.Object> callable( in callable()
139 public static <T> java.util.concurrent.Callable<T> privilegedCallable( in privilegedCallable()
140 java.util.concurrent.Callable<T> callable) { in privilegedCallable()
144 public static <T> java.util.concurrent.Callable<T> privilegedCallableUsingCurrentClassLoader( in privilegedCallableUsingCurrentClassLoader()
145 java.util.concurrent.Callable<T> callable) { in privilegedCallableUsingCurrentClassLoader()
222 public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task) { in submit()
231 java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) in invokeAll()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DAbstractExecutorServiceTest.java46 import java.util.concurrent.Callable;
212 e.submit((Callable) null); in testSubmitNullCallable()
223 final Callable<Void> awaiter = new CheckedCallable<Void>() { in testInterruptedSubmit()
255 Callable c = new Callable() { in testSubmitEE()
286 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
298 List<Callable<Long>> l = new ArrayList<>(); in testInvokeAny3()
299 l.add(new Callable<Long>() { in testInvokeAny3()
315 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny4()
332 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny5()
359 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
[all …]
DForkJoinPoolTest.java43 import java.util.concurrent.Callable;
503 final Callable callable = Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction()
521 final Callable callable = in testSubmitPrivilegedExceptionAction()
540 final Callable callable = in testSubmitFailedPrivilegedExceptionAction()
580 Future<String> future = e.submit((Callable) null); in testSubmitNullCallable()
592 final Callable<Void> awaiter = new CheckedCallable<Void>() { in testInterruptedSubmit()
620 p.submit(new Callable() { in testSubmitEE()
650 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
662 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny3()
678 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny4()
[all …]
DExecutorCompletionService9Test.java42 import java.util.concurrent.Callable;
61 Collection<Callable<Integer>> solvers) in solveAll()
74 Collection<Callable<Integer>> solvers) in solveAny()
113 Set<Callable<Integer>> solvers = Set.of( in testSolveAll()
130 Set<Callable<Integer>> solvers = Set.of( in testSolveAny()
DExecutorsTest.java46 import java.util.concurrent.Callable;
423 class CheckCCL implements Callable<Object> {
476 Callable task = Executors.privilegedCallable(new CheckCCL()); in testPrivilegedCallableWithNoPrivs()
555 Callable c = Executors.callable(new NoOpRunnable()); in testCallable1()
563 Callable c = Executors.callable(new NoOpRunnable(), one); in testCallable2()
571 Callable c = Executors.callable(new PrivilegedAction() { in testCallable3()
580 Callable c = Executors.callable(new PrivilegedExceptionAction() { in testCallable4()
590 Callable c = Executors.callable((Runnable) null); in testCallableNPE1()
600 Callable c = Executors.callable((Runnable) null, one); in testCallableNPE2()
610 Callable c = Executors.callable((PrivilegedAction) null); in testCallableNPE3()
[all …]
DExecutorCompletionServiceTest.java40 import java.util.concurrent.Callable;
90 cs.submit((Callable) null); in testSubmitNullCallable()
175 cs.submit(new Callable() { public String call() throws Exception { in testPollReturnsNull()
225 MyCallableFuture(Callable<V> c) { super(c); } in testNewTaskForCallable()
232 protected <T> RunnableFuture<T> newTaskFor(Callable<T> c) { in testNewTaskForCallable()
238 Callable<String> c = new StringTask(); in testNewTaskForCallable()
DScheduledExecutorSubclassTest.java43 import java.util.concurrent.Callable;
110 …protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> c, RunnableScheduledFuture<V> ta… in decorateTask()
150 Callable task = new CheckedCallable<Boolean>() { in testSchedule1()
958 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
971 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny3()
988 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny4()
1005 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny5()
1032 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
1043 List<Callable<String>> l = new ArrayList<>(); in testInvokeAll3()
1059 List<Callable<String>> l = new ArrayList<>(); in testInvokeAll4()
[all …]
DScheduledExecutorTest.java45 import java.util.concurrent.Callable;
93 Callable task = new CheckedCallable<Boolean>() { in testSchedule1()
906 e.invokeAny(new ArrayList<Callable<String>>()); in testInvokeAny2()
919 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny3()
936 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny4()
953 List<Callable<String>> l = new ArrayList<>(); in testInvokeAny5()
980 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>()); in testInvokeAll2()
991 List<Callable<String>> l = new ArrayList<>(); in testInvokeAll3()
1007 List<Callable<String>> l = new ArrayList<>(); in testInvokeAll4()
1026 List<Callable<String>> l = new ArrayList<>(); in testInvokeAll5()
[all …]
/libcore/luni/src/test/parameter_metadata/src/libcore/java/lang/reflect/parameter/
DParameterMetadataTestClasses.java19 import java.util.concurrent.Callable;
94 Callable<String> anonymousClassObject = new Callable<String>() { in getAnonymousClassWith1ParameterConstructor()
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DForkJoinTaskTest.java24 import java.util.concurrent.Callable;
60 Callable callable = () -> { return Integer.valueOf(42); }; in testAdaptToCallable()
79 Callable callable = () -> { throw new Exception("Test passed"); }; in testAdaptToCallableThrowsException()
/libcore/support/src/test/java/libcore/javax/net/ssl/
DTestSSLSocketPair.java19 import java.util.concurrent.Callable;
79 Future s = executor.submit(new Callable<Void>() { in connect()
88 Future c = executor.submit(new Callable<Void>() { in connect()
/libcore/support/src/test/java/tests/support/
DSupport_Exec.java30 import java.util.concurrent.Callable;
117 private static Callable<String> streamToStringCallable(final InputStream in) { in streamToStringCallable()
118 return new Callable<String>() { in streamToStringCallable()
/libcore/luni/src/test/java/libcore/sun/misc/
DUnsafeTest.java22 import java.util.concurrent.Callable;
42 Callable<Object> callable = Executors.callable(new Runnable() { in test_getUnsafeForbiddenWithSystemCaller()

123