Examples of doDelay()


Examples of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy.doDelay()

        policy.setExponentialBackOff(false);
        policy.setMaximumRetryDelay(500L);

        for (int i = 0; i < 10; i++) {
            long start = System.currentTimeMillis();
            policy.doDelay(i);
            long elapsed = System.currentTimeMillis() - start;
            assertTrue(elapsed <= policy.getMaximumRetryDelay() + precision && elapsed >= 0);
        }
    }
View Full Code Here

Examples of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy.doDelay()

        policy.setMaximumRetryDelay(0L);
        policy.setRetryDelay(50L);

        for (int i = 0; i < 10; i++) {
            long start = System.currentTimeMillis();
            policy.doDelay(i);
            long elapsed = System.currentTimeMillis() - start;
            assertTrue(elapsed >= (policy.getRetryDelay() << i) - precision);
            assertTrue(elapsed <= (policy.getRetryDelay() << i) + precision);
        }
    }
View Full Code Here

Examples of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy.doDelay()

        policy.setMaximumRetryDelay(200L);
        policy.setRetryDelay(50L);

        for (int i = 0; i < 10; i++) {
            long start = System.currentTimeMillis();
            policy.doDelay(i);
            long elapsed = System.currentTimeMillis() - start;
            switch (i) {
            case 0:
                assertTrue(elapsed <= 50 + precision);
                assertTrue(elapsed >= 50 - precision);
View Full Code Here

Examples of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy.doDelay()

        policy.setMaximumRetryDelay(0L);
        policy.setRetryDelay(50L);

        for (int i = 0; i < 10; i++) {
            long start = System.currentTimeMillis();
            policy.doDelay(i);
            long elapsed = System.currentTimeMillis() - start;
            assertTrue(elapsed <= policy.getRetryDelay() + precision);
            assertTrue(elapsed >= policy.getRetryDelay() - precision);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.