use of com.hazelcast.client.executor.tasks.AppendCallable in project hazelcast by hazelcast.
the class ClientDurableExecutorServiceSubmitTest method testSubmitCallable.
@Test
public void testSubmitCallable() throws Exception {
DurableExecutorService service = client.getDurableExecutorService(randomString());
String msg = randomString();
Callable callable = new AppendCallable(msg);
Future result = service.submit(callable);
assertEquals(msg + AppendCallable.APPENDAGE, result.get());
}
use of com.hazelcast.client.executor.tasks.AppendCallable in project hazelcast by hazelcast.
the class ClientExecutorServiceInvokeTest method testInvokeAny.
@Test(expected = UnsupportedOperationException.class)
public void testInvokeAny() throws Throwable {
IExecutorService service = client.getExecutorService(randomString());
Collection<Callable<String>> collection = new ArrayList<Callable<String>>();
collection.add(new AppendCallable());
collection.add(new AppendCallable());
service.invokeAny(collection);
}
use of com.hazelcast.client.executor.tasks.AppendCallable in project hazelcast by hazelcast.
the class ClientExecutorServiceInvokeTest method testInvokeAll.
@Test
public void testInvokeAll() throws Throwable {
IExecutorService service = client.getExecutorService(randomString());
String msg = randomString();
Collection<Callable<String>> collection = new ArrayList<Callable<String>>();
collection.add(new AppendCallable(msg));
collection.add(new AppendCallable(msg));
List<Future<String>> results = service.invokeAll(collection);
for (Future<String> result : results) {
assertEquals(msg + AppendCallable.APPENDAGE, result.get());
}
}
use of com.hazelcast.client.executor.tasks.AppendCallable in project hazelcast by hazelcast.
the class ClientExecutorServiceInvokeTest method testInvokeAnyTimeOut.
@Test(expected = UnsupportedOperationException.class)
public void testInvokeAnyTimeOut() throws Throwable {
IExecutorService service = client.getExecutorService(randomString());
Collection<Callable<String>> collection = new ArrayList<Callable<String>>();
collection.add(new AppendCallable());
collection.add(new AppendCallable());
service.invokeAny(collection, 1, TimeUnit.MINUTES);
}
use of com.hazelcast.client.executor.tasks.AppendCallable in project hazelcast by hazelcast.
the class ClientExecutorServiceSubmitTest method testSubmitCallable.
@Test
public void testSubmitCallable() throws Exception {
IExecutorService service = client.getExecutorService(randomString());
String msg = randomString();
Callable callable = new AppendCallable(msg);
Future result = service.submit(callable);
assertEquals(msg + AppendCallable.APPENDAGE, result.get());
}
Aggregations