Skip to content

Commit 3e52d22

Browse files
handler error on test
1 parent cd56d08 commit 3e52d22

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

src/main/java/com/osrm/client/Main.java

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,36 @@
55
public class Main {
66
public static void main(String[] args) throws EmptyUrlException {
77

8-
OSRMClient client = new OSRMClient("http://localhost:8080");
9-
List <GeoLocation> locations = new ArrayList<>();
8+
try {
9+
OSRMClient client = new OSRMClient("http://localhost:8008");
10+
List<GeoLocation> locations = new ArrayList<>();
1011

11-
GeoLocation geo1 = new GeoLocation(-33.416943, -70.60952);
12-
GeoLocation geo2 = new GeoLocation(-33.416943, -70.60952);
13-
GeoLocation geo3 = new GeoLocation(-33.4445755, -70.6404943);
14-
GeoLocation geo4 = new GeoLocation(-33.4457167, -70.61926449999999);
12+
GeoLocation geo1 = new GeoLocation(-33.416943, -70.60952);
13+
GeoLocation geo2 = new GeoLocation(-33.416943, -70.60952);
14+
GeoLocation geo3 = new GeoLocation(-33.4445755, -70.6404943);
15+
GeoLocation geo4 = new GeoLocation(-33.4457167, -70.61926449999999);
1516

16-
locations.add(geo1);
17-
locations.add(geo2);
18-
locations.add(geo3);
19-
locations.add(geo4);
17+
locations.add(geo1);
18+
locations.add(geo2);
19+
locations.add(geo3);
20+
locations.add(geo4);
2021

21-
// low fmv
22-
double speedRate = 2;
23-
String country = "CL";
22+
// low fmv
23+
double speedRate = 2;
24+
String country = "CL";
2425

25-
// token
26-
String token = "None";
26+
// token
27+
String token = "None";
2728

28-
String profile = "car";
29+
String profile = "car";
2930

30-
OSRMDistanceResponse response = client.getDistanceMatrix(locations, speedRate, country, token, profile, null);
31+
OSRMDistanceResponse response = client.getDistanceMatrix(locations, speedRate, country, token, profile,
32+
null);
3133

32-
System.out.println(response);
34+
System.out.println(response);
35+
}catch (Exception e){
36+
e.printStackTrace();
37+
System.out.println("End with errors.");
38+
}
3339
}
3440
}

0 commit comments

Comments
 (0)