Skip to content

Commit

Permalink
navigation test avoid one segment #19
Browse files Browse the repository at this point in the history
  • Loading branch information
yaelAmitay committed Dec 30, 2016
1 parent 0a53b23 commit 0222219
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static LatLng[] showRoute(Location source, Location destination, Integer
return arrayToLatLng(s.getShapePoints());
}

private static LatLng[] arrayToLatLng(Double[] shapePointsArr) {
public static LatLng[] arrayToLatLng(Double[] shapePointsArr) {
LatLng[] $ = new LatLng[shapePointsArr.length / 2];
int k = 0;
for (int i = 0; i < shapePointsArr.length - 1; i += 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void getRouteFromServersWithLinksToAvoid() throws CommunicationFailed {
Latlng to = new Latlng(31.770981, 34.620567);// HaYam HaTichon Blvd 1
List<MapSegment> segmentsToAvoid = new ArrayList<MapSegment>();
segmentsToAvoid.add(Navigation.getMapSegmentOfLatLng(31.769955, 34.623123));// bareket
// st
// st
Route r = Navigation.getRouteFromMapQuest(from, to, segmentsToAvoid);
Shape shape = r.getShape();
Double[] shapePoints = shape.getShapePoints();
Expand All @@ -70,15 +70,21 @@ public void getRouteFromServersWithLinksToAvoid() throws CommunicationFailed {
}

@Test
@Ignore
public void avoidSegement() throws CommunicationFailed {
public void avoidOneSegement() throws CommunicationFailed {
// TODO this test is temporal for it relay on things that will change!
Latlng from = new Latlng(31.768762, 34.632052);// abba ahimeir
Latlng to = new Latlng(31.770981, 34.620567);// HaYam HaTichon Blvd 1
List<MapSegment> segmentsToAvoid = new ArrayList<MapSegment>();
segmentsToAvoid.add(Navigation.getMapSegmentOfLatLng(31.76935, 34.626793));// sd
Double[] shapePoints = Navigation.getRouteFromMapQuest(from, to, segmentsToAvoid).getShape().getShapePoints();

MapView mapview = JxMapsFunctionality.getMapView();
JxMapsConvertor.displayRoute(mapview, Navigation.arrayToLatLng(shapePoints));
try {
Thread.sleep(10000000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@Test
Expand All @@ -96,4 +102,5 @@ public void displayMap() throws CommunicationFailed {
e.printStackTrace();
}
}

}

0 comments on commit 0222219

Please sign in to comment.