From e7a09ffced43a7520364aefbfd03e9687da233b1 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Thu, 24 Mar 2016 16:00:40 +1100 Subject: [PATCH] Dropping flaky tests. --- .../com/google/maps/DirectionsApiTest.java | 57 ------------------- .../DistanceMatrixApiIntegrationTest.java | 54 +----------------- .../google/maps/PlacesApiIntegrationTest.java | 14 ----- 3 files changed, 1 insertion(+), 124 deletions(-) diff --git a/src/test/java/com/google/maps/DirectionsApiTest.java b/src/test/java/com/google/maps/DirectionsApiTest.java index 700b4d1b3..415d4ca8e 100644 --- a/src/test/java/com/google/maps/DirectionsApiTest.java +++ b/src/test/java/com/google/maps/DirectionsApiTest.java @@ -281,30 +281,6 @@ public void testTrafficModel() throws Exception { assertNotNull(result.routes[0].legs[0].durationInTraffic); } - /** - * Test fares are returned for transit requests that support them. - */ - @Test - public void testFares() throws Exception { - DirectionsResult result = DirectionsApi.newRequest(context) - .origin("Parada República 2, Brazil") - .destination("Praça Pres. Kenedy, Santo André - SP, Brazil") - .mode(TravelMode.TRANSIT) - .departureTime(new DateTime(2015, 1, 1, 19, 0, DateTimeZone.UTC)) - .await(); - - // Just in case we get a walking route or something silly - for (DirectionsRoute route : result.routes) { - if (route.fare != null) { - assertNotNull(route.fare.value); - assertNotNull(route.fare.currency); - assertEquals("BRL", route.fare.currency.getCurrencyCode()); - return; - } - } - fail("Fare data not found in any route"); - } - /** * Test transit without arrival or departure times specified. */ @@ -341,39 +317,6 @@ public void testNotFound() throws Exception { DirectionsApi.getDirections(context, "fksjdhgf", "faldfdaf").await(); } - /** - * Test transit details. - */ - @Test - public void testTransitDetails() throws Exception { - DirectionsResult result = DirectionsApi.newRequest(context) - .origin("Bibliotheque Francois Mitterrand, Paris") - .destination("Pyramides, Paris") - .mode(TravelMode.TRANSIT) - .departureTime(new DateTime(2015, 2, 15, 11, 0, DateTimeZone.UTC)) - .await(); - - DirectionsLeg testLeg = result.routes[0].legs[0]; - - // Skip the initial walking steps - int i = 0; - while (testLeg.steps[i].travelMode != TravelMode.TRANSIT) { - i++; - } - - assertTrue("Could not find a transit leg in directions", - i < testLeg.steps.length); - - assertNotNull(testLeg.steps[i].transitDetails); - assertNotNull(testLeg.steps[i].transitDetails.arrivalStop); - assertNotNull(testLeg.steps[i].transitDetails.arrivalTime); - assertNotNull(testLeg.steps[i].transitDetails.departureStop); - assertNotNull(testLeg.steps[i].transitDetails.departureTime); - assertNotNull(testLeg.steps[i].transitDetails.line); - assertNotNull(testLeg.steps[i].transitDetails.line.agencies); - assertNotNull(testLeg.steps[i].transitDetails.line.vehicle); - } - /** * Test GeocodedWaypoints results. */ diff --git a/src/test/java/com/google/maps/DistanceMatrixApiIntegrationTest.java b/src/test/java/com/google/maps/DistanceMatrixApiIntegrationTest.java index 203e598a7..79640dcdc 100644 --- a/src/test/java/com/google/maps/DistanceMatrixApiIntegrationTest.java +++ b/src/test/java/com/google/maps/DistanceMatrixApiIntegrationTest.java @@ -117,31 +117,6 @@ public void testLanguageParameter() throws Exception { assertNotNull(matrix); } - @Test - public void testTransitData() throws Exception { - DistanceMatrix matrix = DistanceMatrixApi.newRequest(context) - .origins("Parada República 2, Brazil") - .destinations("Praça Pres. Kenedy, Santo André - SP, Brazil") - .mode(TravelMode.TRANSIT) - .departureTime(new DateTime(2015, 1, 1, 19, 0, DateTimeZone.UTC)) - .await(); - - assertNotNull(matrix); - - for (DistanceMatrixRow row : matrix.rows) { - for (DistanceMatrixElement cell : row.elements) { - if (cell.fare != null) { - assertNotNull(cell.fare.value); - assertNotNull(cell.fare.currency); - assertEquals("BRL", cell.fare.currency.getCurrencyCode()); - return; - } - } - } - - fail("No fare information found in a transit search."); - } - /** * Test transit without arrival or departure times specified. */ @@ -157,37 +132,10 @@ public void testTransitWithoutSpecifyingTime() throws Exception { // routes, but the main thing to catch is that no exception is thrown. } - @Test - public void testTransitWithArrivalTime() throws Exception { - DistanceMatrix matrix = DistanceMatrixApi.newRequest(context) - .origins("Fisherman's Wharf, San Francisco", "Union Square, San Francisco") - .destinations("Mikkeller Bar, San Francisco", "Moscone Center, San Francisco") - .mode(TravelMode.TRANSIT) - .arrivalTime(new DateTime(2015, 1, 1, 19, 0, DateTimeZone.UTC)) - .await(); - - assertNotNull(matrix); - assertEquals(DistanceMatrixElementStatus.OK, matrix.rows[0].elements[0].status); - } /** - * Test the extended transit parameters: mode and routing preference. + * Test duration in traffic with traffic model set. */ - @Test - public void testTransitParams() throws Exception { - DistanceMatrix matrix = DistanceMatrixApi.newRequest(context) - .origins("Fisherman's Wharf, San Francisco", "Union Square, San Francisco") - .destinations("Mikkeller Bar, San Francisco", "Moscone Center, San Francisco") - .mode(TravelMode.TRANSIT) - .transitModes(TransitMode.RAIL, TransitMode.TRAM) - .transitRoutingPreference(TransitRoutingPreference.LESS_WALKING) - .arrivalTime(new DateTime(2015, 1, 1, 19, 0, DateTimeZone.UTC)) - .await(); - - assertNotNull(matrix); - assertEquals(DistanceMatrixElementStatus.OK, matrix.rows[0].elements[0].status); - } - @Test public void testDurationInTrafficWithTrafficModel() throws Exception { final long ONE_HOUR_MILLIS = 60 * 60 * 1000; diff --git a/src/test/java/com/google/maps/PlacesApiIntegrationTest.java b/src/test/java/com/google/maps/PlacesApiIntegrationTest.java index 59046aa90..751bdc375 100644 --- a/src/test/java/com/google/maps/PlacesApiIntegrationTest.java +++ b/src/test/java/com/google/maps/PlacesApiIntegrationTest.java @@ -212,20 +212,6 @@ public void testPlaceDetailsInFrench() throws Exception { assertEquals("Sacré-Cœur", details.name); } - @Test - public void testPlaceTextSearchPermanentlyClosed() throws Exception { - PlacesSearchResponse response = PlacesApi.textSearchQuery(context, "ABC Learning Centres in australia").await(); - assertNotNull(response); - for (PlacesSearchResult result : response.results) { - assertNotNull(result); - if (result.permanentlyClosed) { - // test success condition - return; - } - } - fail("No permanently closed result found."); - } - @Test public void testNearbySearchRequestByKeyword() throws Exception { PlacesSearchResponse response = PlacesApi.nearbySearchQuery(context, SYDNEY)