Package org.jclouds.http.handlers

Examples of org.jclouds.http.handlers.BackoffLimitedRetryHandler.shouldRetryRequest()


      LoadingCache<Credentials, Access> cache = createMock(LoadingCache.class);
      BackoffLimitedRetryHandler backoffHandler = createMock(BackoffLimitedRetryHandler.class);

      expect(response.getPayload()).andReturn(Payloads.newStringPayload(
                  "The server has waited too long for the request to be sent by the client.")).times(2);
      expect(backoffHandler.shouldRetryRequest(command, response)).andReturn(true).once();
      expect(response.getStatusCode()).andReturn(408).once();

      replay(command);
      replay(response);
      replay(cache);
View Full Code Here


                  "{\"error\":[\"Cannot update sandbox bfd68d4052f44053b2e593a33b5e1cd5: checksum 9b7c23369f4b576451216c39f214af6c was not uploaded\"]}")
            .build();

      expect(command.getFailureCount()).andReturn(0);
      expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
      expect(retry.shouldRetryRequest(command, response)).andReturn(true);

      replay(retry);
      replay(command);

      ChefApiErrorRetryHandler handler = new ChefApiErrorRetryHandler(retry);
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.