Examples of RetrySimulator


Examples of org.springframework.retry.support.RetrySimulator

    }

  @Test
   public void testSingleBackoff() throws Exception {
        ExponentialBackOffPolicy backOffPolicy = makeBackoffPolicy();
        RetrySimulator simulator = new RetrySimulator(backOffPolicy, makeRetryPolicy());
        RetrySimulation simulation = simulator.executeSimulation(1);

        List<Long> sleeps = simulation.getLongestTotalSleepSequence().getSleeps();
        System.out.println("Single trial of " + backOffPolicy + ": sleeps=" + sleeps);
        assertEquals(MAX_RETRIES - 1, sleeps.size());
        long initialInterval = backOffPolicy.getInitialInterval();
View Full Code Here

Examples of org.springframework.retry.support.RetrySimulator

    }

  @Test
  public void testMultiBackOff() throws Exception {
        ExponentialBackOffPolicy backOffPolicy = makeBackoffPolicy();
        RetrySimulator simulator = new RetrySimulator(backOffPolicy, makeRetryPolicy());
        RetrySimulation simulation = simulator.executeSimulation(NUM_TRIALS);

        System.out.println("Ran " + NUM_TRIALS + " backoff trials.  Each trial retried " + MAX_RETRIES + " times");
        System.out.println("Policy: " + backOffPolicy);
        System.out.println("All generated backoffs:");
        System.out.println("    " + simulation.getPercentiles());
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.