diff --git a/OsmAnd-java/build.xml b/OsmAnd-java/build.xml index 3851c79f4c..2dcba635dd 100644 --- a/OsmAnd-java/build.xml +++ b/OsmAnd-java/build.xml @@ -58,7 +58,7 @@ - + diff --git a/OsmAnd-java/run_turn_lanes_test.sh b/OsmAnd-java/run_turn_lanes_test.sh new file mode 100644 index 0000000000..9561a74452 --- /dev/null +++ b/OsmAnd-java/run_turn_lanes_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ ! -d bin ]; + then + echo "Building OsmAnd-java..."; + ant build +fi +echo "Starting tests..." +ant run-turn-lanes-test +echo "Results can be found in result.txt file." \ No newline at end of file diff --git a/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java b/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java index d56cc69f4b..608685449d 100644 --- a/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java +++ b/OsmAnd-java/test/java/net/osmand/router/RouteResultPreparationTest.java @@ -3,6 +3,7 @@ package net.osmand.router; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.osmand.PlatformUtil; +import net.osmand.router.TestEntry; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.data.LatLon; import org.apache.commons.logging.Log; @@ -64,8 +65,9 @@ public class RouteResultPreparationTest { @Parameterized.Parameters(name = "{index}: {0}") public static Collection data() throws IOException { - InputStream inputStream = RouteResultPreparationTest.class.getResourceAsStream("test_routes.json"); - Reader reader = new InputStreamReader(inputStream); + String fileName = "test_turn_lanes.json"; + + Reader reader = new FileReader(fileName); Gson gson = new GsonBuilder().setPrettyPrinting().create(); TestEntry[] testEntries = gson.fromJson(reader, TestEntry[].class); ArrayList twoDArray = new ArrayList(); @@ -113,7 +115,7 @@ public class RouteResultPreparationTest { } - String getLanesString(RouteSegmentResult segment) { + private String getLanesString(RouteSegmentResult segment) { String turn = segment.getTurnType().toString(); final int[] lns = segment.getTurnType().getLanes(); if (lns != null) { diff --git a/OsmAnd-java/test/java/net/osmand/router/test_routes.json b/OsmAnd-java/test_turn_lanes.json similarity index 100% rename from OsmAnd-java/test/java/net/osmand/router/test_routes.json rename to OsmAnd-java/test_turn_lanes.json