Search in sources :

Example 16 with AppendCallable

use of com.hazelcast.client.test.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);
}
Also used : AppendCallable(com.hazelcast.client.test.executor.tasks.AppendCallable) ArrayList(java.util.ArrayList) IExecutorService(com.hazelcast.core.IExecutorService) HazelcastTestSupport.randomString(com.hazelcast.test.HazelcastTestSupport.randomString) Callable(java.util.concurrent.Callable) AppendCallable(com.hazelcast.client.test.executor.tasks.AppendCallable) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 17 with AppendCallable

use of com.hazelcast.client.test.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);
}
Also used : AppendCallable(com.hazelcast.client.test.executor.tasks.AppendCallable) ArrayList(java.util.ArrayList) IExecutorService(com.hazelcast.core.IExecutorService) HazelcastTestSupport.randomString(com.hazelcast.test.HazelcastTestSupport.randomString) Callable(java.util.concurrent.Callable) AppendCallable(com.hazelcast.client.test.executor.tasks.AppendCallable) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 18 with AppendCallable

use of com.hazelcast.client.test.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());
    }
}
Also used : AppendCallable(com.hazelcast.client.test.executor.tasks.AppendCallable) ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future) IExecutorService(com.hazelcast.core.IExecutorService) HazelcastTestSupport.randomString(com.hazelcast.test.HazelcastTestSupport.randomString) Callable(java.util.concurrent.Callable) AppendCallable(com.hazelcast.client.test.executor.tasks.AppendCallable) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

AppendCallable (com.hazelcast.client.test.executor.tasks.AppendCallable)18 HazelcastTestSupport.randomString (com.hazelcast.test.HazelcastTestSupport.randomString)18 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)18 QuickTest (com.hazelcast.test.annotation.QuickTest)18 Test (org.junit.Test)18 IExecutorService (com.hazelcast.core.IExecutorService)14 Callable (java.util.concurrent.Callable)9 CountDownLatch (java.util.concurrent.CountDownLatch)8 MapPutPartitionAwareCallable (com.hazelcast.client.test.executor.tasks.MapPutPartitionAwareCallable)5 AtomicReference (java.util.concurrent.atomic.AtomicReference)5 NullCallable (com.hazelcast.client.test.executor.tasks.NullCallable)4 Member (com.hazelcast.cluster.Member)4 MultiExecutionCallback (com.hazelcast.core.MultiExecutionCallback)4 DurableExecutorService (com.hazelcast.durableexecutor.DurableExecutorService)4 ArrayList (java.util.ArrayList)4 Future (java.util.concurrent.Future)4 SelectAllMembers (com.hazelcast.client.test.executor.tasks.SelectAllMembers)3 MemberSelector (com.hazelcast.cluster.MemberSelector)3 ExecutionCallback (com.hazelcast.core.ExecutionCallback)1