Search in sources :

Example 6 with BasicTestCallable

use of com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable in project hazelcast by hazelcast.

the class ClientDurableExecutorServiceTest method testInvokeAll.

@Test
public void testInvokeAll() throws Exception {
    DurableExecutorService service = client.getDurableExecutorService(randomString());
    List<BasicTestCallable> callables = Collections.emptyList();
    expectedException.expect(UnsupportedOperationException.class);
    service.invokeAll(callables);
}
Also used : DurableExecutorService(com.hazelcast.durableexecutor.DurableExecutorService) BasicTestCallable(com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 7 with BasicTestCallable

use of com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable in project hazelcast by hazelcast.

the class ClientDurableExecutorServiceTest method testInvokeAny_WithTimeout.

@Test
public void testInvokeAny_WithTimeout() throws Exception {
    DurableExecutorService service = client.getDurableExecutorService(randomString());
    List<BasicTestCallable> callables = Collections.emptyList();
    expectedException.expect(UnsupportedOperationException.class);
    service.invokeAny(callables, 1, TimeUnit.SECONDS);
}
Also used : DurableExecutorService(com.hazelcast.durableexecutor.DurableExecutorService) BasicTestCallable(com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 8 with BasicTestCallable

use of com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable in project hazelcast by hazelcast.

the class ClientDurableExecutorServiceTest method testInvokeAny.

@Test
public void testInvokeAny() throws Exception {
    DurableExecutorService service = client.getDurableExecutorService(randomString());
    List<BasicTestCallable> callables = Collections.emptyList();
    expectedException.expect(UnsupportedOperationException.class);
    service.invokeAny(callables);
}
Also used : DurableExecutorService(com.hazelcast.durableexecutor.DurableExecutorService) BasicTestCallable(com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 9 with BasicTestCallable

use of com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable in project hazelcast by hazelcast.

the class ClientDurableExecutorServiceTest method test_whenRingBufferIsFull_thenThrowRejectedExecutionException.

@Test
public void test_whenRingBufferIsFull_thenThrowRejectedExecutionException() throws Exception {
    String key = randomString();
    DurableExecutorService service = client.getDurableExecutorService(SINGLE_TASK + randomString());
    service.submitToKeyOwner(new SleepingTask(100), key);
    DurableExecutorServiceFuture<String> future = service.submitToKeyOwner(new BasicTestCallable(), key);
    expectedException.expect(new RootCauseMatcher(RejectedExecutionException.class));
    future.get();
}
Also used : DurableExecutorService(com.hazelcast.durableexecutor.DurableExecutorService) SleepingTask(com.hazelcast.executor.ExecutorServiceTestSupport.SleepingTask) BasicTestCallable(com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable) HazelcastTestSupport.randomString(com.hazelcast.test.HazelcastTestSupport.randomString) RootCauseMatcher(com.hazelcast.util.RootCauseMatcher) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

DurableExecutorService (com.hazelcast.durableexecutor.DurableExecutorService)9 BasicTestCallable (com.hazelcast.executor.ExecutorServiceTestSupport.BasicTestCallable)9 ParallelTest (com.hazelcast.test.annotation.ParallelTest)8 QuickTest (com.hazelcast.test.annotation.QuickTest)8 Test (org.junit.Test)8 HazelcastTestSupport.randomString (com.hazelcast.test.HazelcastTestSupport.randomString)5 SleepingTask (com.hazelcast.executor.ExecutorServiceTestSupport.SleepingTask)3 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 ExecutionException (java.util.concurrent.ExecutionException)2 StaleTaskIdException (com.hazelcast.durableexecutor.StaleTaskIdException)1 RootCauseMatcher (com.hazelcast.util.RootCauseMatcher)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1