Skip to content

Commit

Permalink
Merge pull request #124 from domesticmouse/master
Browse files Browse the repository at this point in the history
Tidyup tests + better javadoc.
  • Loading branch information
samthor committed Jan 20, 2016
2 parents d54de1a + b346d63 commit 97c056b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/google/maps/GeoApiContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public GeoApiContext setWriteTimeout(long timeout, TimeUnit unit) {
}

/**
* Sets the time limit for which retry-able errors will be retried. Defaults to 60 seconds. Set
* to zero to disable.
* Sets the cumulative time limit for which retry-able errors will be retried. Defaults to 60
* seconds. Set to zero to retry requests forever.
*/
public GeoApiContext setRetryTimeout(long timeout, TimeUnit unit) {
this.errorTimeout = unit.toMillis(timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ElevationApiIntegrationTest extends AuthenticatedTest {

public static final double SYDNEY_ELEVATION = 19.11174774169922;
public static final double SYDNEY_POINT_ELEVATION = 19.10829925537109;
public static final double MELBOURNE_ELEVATION = 25.49982643127441;
public static final double MELBOURNE_ELEVATION = 9.253130912780762;
private static final double EPSILON = .00001;
private static final LatLng SYDNEY = new LatLng(-33.867487, 151.206990);
private static final LatLng MELBOURNE = new LatLng(-37.814107, 144.963280);
Expand Down
7 changes: 5 additions & 2 deletions src/test/java/com/google/maps/GeocodingApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,15 @@ public void testPartialMatch() throws Exception {
assertTrue(results[0].partialMatch);
}

/**
* Testing UTF8 result parsing.
*/
@Test
public void testUtfResult() throws Exception {
GeocodingResult[] results = GeocodingApi.newRequest(context)
.components(ComponentFilter.postalCode("96766"))
.latlng(new LatLng(46.8023388,1.6551867))
.await();

assertEquals("Līhuʻe, HI 96766, USA", results[0].formattedAddress);
assertEquals("1 Rue Fernand Raynaud, 36000 Châteauroux, France", results[0].formattedAddress);
}
}

0 comments on commit 97c056b

Please sign in to comment.