another small comment https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/test/java/com/google/api/client/util/FixedBackOffTest.java File google-http-client/src/test/java/com/google/api/client/util/FixedBackOffTest.java (right): https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/test/java/com/google/api/client/util/FixedBackOffTest.java#newcode26 google-http-client/src/test/java/com/google/api/client/util/FixedBackOffTest.java:26: public void testGetNextBackOffMillis_zero() { rename the ...
11 years, 1 month ago
(2013-03-12 20:25:56 UTC)
#2
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java File google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java (right): https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java#newcode32 google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java:32: * If {@code true}, it will call {@link Thread#sleep(long)} ...
11 years, 1 month ago
(2013-03-13 15:54:54 UTC)
#3
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/...
File
google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java
(right):
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/...
google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java:32:
* If {@code true}, it will call {@link Thread#sleep(long)} with the specified
number of
On 2013/03/12 20:07:56, peleyal wrote:
> change to: ... "it will call {@link Sleeper#sleep(long)}"
Done.
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/...
File
google-http-client/src/main/java/com/google/api/client/util/FixedBackOff.java
(right):
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/...
google-http-client/src/main/java/com/google/api/client/util/FixedBackOff.java:29:
public class FixedBackOff implements BackOff {
On 2013/03/12 20:07:56, peleyal wrote:
> I think that we should supply another parameter (similar to
maxElapsedTimeMillis
> on ExponentialBackOf).
>
> Actually why not adding it to the BackOff interface? - it will be really
useful
> for testing
I decided to just eliminate FixedBackOff and replace it with MockBackOff. You
can always just use ExponentialBackOff with multiplier = 1.
I don't understand what you are proposing regarding maxElapsedTimeMillis. Can
you please explain.
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/main/...
google-http-client/src/main/java/com/google/api/client/util/FixedBackOff.java:55:
return new FixedBackOff(0);
On 2013/03/12 20:07:56, peleyal wrote:
> [optional] you can store a variable and return the same instance. same for
stop
> method
Done.
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/test/...
File
google-http-client/src/test/java/com/google/api/client/util/BackOffUtilsTest.java
(right):
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/test/...
google-http-client/src/test/java/com/google/api/client/util/BackOffUtilsTest.java:41:
}
On 2013/03/12 20:07:56, peleyal wrote:
> If you add maxElapsedTimeMillis to BackOff it will be great to add a test
> similar to the following:
>
> while (BackOffUtils.next(sleeper, new FixedBackOff(millis)))
> assertEquals(some_number, sleeper.getCount())
Done.
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/test/...
File
google-http-client/src/test/java/com/google/api/client/util/FixedBackOffTest.java
(right):
https://codereview.appspot.com/7443045/diff/9001/google-http-client/src/test/...
google-http-client/src/test/java/com/google/api/client/util/FixedBackOffTest.java:26:
public void testGetNextBackOffMillis_zero() {
On 2013/03/12 20:25:56, peleyal wrote:
> rename the method (should not contain _zero in it)
Unfortunately, that's the Google test method name policy. To be honest, I don't
agree with it, but more important to me is the idea of following a single style
standard.
https://codereview.appspot.com/7443045/diff/24001/google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java File google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java (right): https://codereview.appspot.com/7443045/diff/24001/google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java#newcode89 google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java:89: public final int getNumberOfRetries() { [optional] as discussed, I ...
11 years, 1 month ago
(2013-03-13 16:59:41 UTC)
#4
https://codereview.appspot.com/7443045/diff/24001/google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java File google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java (right): https://codereview.appspot.com/7443045/diff/24001/google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java#newcode89 google-http-client/src/main/java/com/google/api/client/testing/util/MockBackOff.java:89: public final int getNumberOfRetries() { On 2013/03/13 16:59:41, peleyal ...
11 years, 1 month ago
(2013-03-13 18:49:28 UTC)
#5
Issue 7443045: http: Sleeper, BackOff, and ExponentialBackOff
(Closed)
Created 11 years, 1 month ago by yanivi
Modified 11 years, 1 month ago
Reviewers: peleyal
Base URL: https://code.google.com/p/google-http-java-client/
Comments: 18