}
}
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"));