Search in sources :

Example 1 with CommandInvoker

use of org.activiti.engine.impl.interceptor.CommandInvoker in project Activiti by Activiti.

the class RetryInterceptorTest method testRetryInterceptor.

public void testRetryInterceptor() {
    RetryInterceptor retryInterceptor = new RetryInterceptor();
    retryInterceptor.setNext(new CommandInvoker());
    try {
        retryInterceptor.execute(new CommandConfig(), new CommandThrowingOptimisticLockingException());
        fail("ActivitiException expected.");
    } catch (ActivitiException e) {
        assertTrue(e.getMessage().contains(retryInterceptor.getNumOfRetries() + " retries failed"));
    }
}
Also used : CommandInvoker(org.activiti.engine.impl.interceptor.CommandInvoker) ActivitiException(org.activiti.engine.ActivitiException) CommandConfig(org.activiti.engine.impl.interceptor.CommandConfig) RetryInterceptor(org.activiti.engine.impl.interceptor.RetryInterceptor)

Aggregations

ActivitiException (org.activiti.engine.ActivitiException)1 CommandConfig (org.activiti.engine.impl.interceptor.CommandConfig)1 CommandInvoker (org.activiti.engine.impl.interceptor.CommandInvoker)1 RetryInterceptor (org.activiti.engine.impl.interceptor.RetryInterceptor)1