Search in sources :

Example 1 with TestTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.TestTaskExecutor in project CzechIdMng by bcvsolutions.

the class DefaultLongRunningTaskManagerIntegrationTest method testDisallowConcurrentExecution.

@Test(expected = ConcurrentExecutionException.class)
public void testDisallowConcurrentExecution() {
    TestTaskExecutor executorOne = new TestTaskExecutor();
    executorOne.setCount(30L);
    LongRunningFutureTask<Boolean> longRunningFutureTask = manager.execute(executorOne);
    helper.waitForResult(res -> {
        return !service.get(longRunningFutureTask.getExecutor().getLongRunningTaskId()).isRunning();
    });
    TestTaskExecutor executorTwo = new TestTaskExecutor();
    executorTwo.setCount(10L);
    manager.executeSync(executorTwo);
}
Also used : TestTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.TestTaskExecutor) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

TestTaskExecutor (eu.bcvsolutions.idm.core.scheduler.task.impl.TestTaskExecutor)1 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)1 Test (org.junit.Test)1