Skip to content

Commit ee53d3c

Browse files
committed
fix broken QueryTorture test
1 parent b775785 commit ee53d3c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/src/main/java/com/graphhopper/tools/QueryTorture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public String createQueryString()
336336
if (!qStr.isEmpty())
337337
qStr += "&";
338338

339-
qStr += "point=" + pointStr;
339+
qStr += "point=" + encodeURL(pointStr);
340340
}
341341
for (Entry<String, String> e : params.entrySet())
342342
{

tools/src/test/java/com/graphhopper/tools/QueryTortureTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public class QueryTortureTest
3030
@Test
3131
public void testGetQuery()
3232
{
33-
Query result = Query.parse("2013-08-07 18:06:50,905 [qtp1329318374-81] INFO graphhopper.http.GraphHopperServlet - point=51.076329,13.738409&point=52.517037,13.38886&type=jsonp 46.4.67.134 en_US Wget/1.13.4 (linux-gnu) 51.076329, 13.738409->52.517037, 13.38886, distance: 189.4806800000001, time:123min, points:907, took:0.007393159, debug - idLookup:0.002483692s, algoInit:1.20837E-4s, dijkstraCH-routing:0.003138361s, extract time:1.66755E-4, simplify (1219->907):0.001040086s, instructions:2.26986E-4s, dijkstrabi, fastest, CAR");
34-
assertEquals("point=51.076329,13.738409&point=52.517037,13.38886&type=jsonp", result.createQueryString());
35-
assertEquals(51.076329, result.start.lat, 1e-5);
36-
assertEquals(13.38886, result.end.lon, 1e-5);
33+
Query result = Query.parse("2016-05-04 16:37:37,647 [qtp1604002113-823] INFO com.graphhopper.http.GHBaseServlet - point=46.444481%2C11.306992&point=46.07847%2C11.178589&locale=en_US&vehicle=car&weighting=fastest&elevation=true 127.0.0.1 en_US Directions API 195.232.147.121 [46.456721,11.258966, 46.15583,11.153478, 46.067933,11.223352, 46.456721,11.258966], took:0.008627106, , fastest, car, alternatives: 1, distance0: 146967.68084669442, time0: 112min, points0: 1507, debugInfo: idLookup:0.004824006s; , algoInit:2.6879E-5s, dijkstrabiCH-routing:5.69366E-4s, extract time:9.987E-5;, algoInit:1.6976E-5s, dijkstrabiCH-routing:3.22521E-4s, extract time:5.9076E-5;, algoInit:1.6084E-5s, dijkstrabiCH-routing:6.75566E-4s, extract time:8.2527E-5;, algoInit:2.6879E-5s, dijkstrabiCH-routing:5.69366E-4s, extract time:9.987E-5;, algoInit:1.6976E-5s, dijkstrabiCH-routing:3.22521E-4s, extract time:5.9076E-5;, algoInit:1.6084E-5s, dijkstrabiCH-routing:6.75566E-4s, extract time:8.2527E-5, simplify (1903->1507)");
34+
assertEquals("point=46.444481%2C11.306992&point=46.07847%2C11.178589&elevation=true&locale=en_US&weighting=fastest&vehicle=car", result.createQueryString());
35+
assertEquals(46.444481, result.start.lat, 1e-5);
36+
assertEquals(11.178589, result.end.lon, 1e-5);
3737
}
3838
}

0 commit comments

Comments
 (0)