Add bash script in order to start turn lanes tests.
This commit is contained in:
parent
e01176d4bd
commit
f57ccf9d6b
4 changed files with 16 additions and 4 deletions
|
@ -58,7 +58,7 @@
|
||||||
</copy>
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="run-route-test" >
|
<target name="run-turn-lanes-test" >
|
||||||
<junit printsummary="yes" haltonfailure="yes" showoutput="yes">
|
<junit printsummary="yes" haltonfailure="yes" showoutput="yes">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement path="bin"/>
|
<pathelement path="bin"/>
|
||||||
|
|
10
OsmAnd-java/run_turn_lanes_test.sh
Normal file
10
OsmAnd-java/run_turn_lanes_test.sh
Normal file
|
@ -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."
|
|
@ -3,6 +3,7 @@ package net.osmand.router;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.router.TestEntry;
|
||||||
import net.osmand.binary.BinaryMapIndexReader;
|
import net.osmand.binary.BinaryMapIndexReader;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -64,8 +65,9 @@ public class RouteResultPreparationTest {
|
||||||
@Parameterized.Parameters(name = "{index}: {0}")
|
@Parameterized.Parameters(name = "{index}: {0}")
|
||||||
public static Collection<Object[]> data() throws IOException {
|
public static Collection<Object[]> data() throws IOException {
|
||||||
|
|
||||||
InputStream inputStream = RouteResultPreparationTest.class.getResourceAsStream("test_routes.json");
|
String fileName = "test_turn_lanes.json";
|
||||||
Reader reader = new InputStreamReader(inputStream);
|
|
||||||
|
Reader reader = new FileReader(fileName);
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
TestEntry[] testEntries = gson.fromJson(reader, TestEntry[].class);
|
TestEntry[] testEntries = gson.fromJson(reader, TestEntry[].class);
|
||||||
ArrayList<Object[]> twoDArray = new ArrayList<Object[]>();
|
ArrayList<Object[]> twoDArray = new ArrayList<Object[]>();
|
||||||
|
@ -113,7 +115,7 @@ public class RouteResultPreparationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String getLanesString(RouteSegmentResult segment) {
|
private String getLanesString(RouteSegmentResult segment) {
|
||||||
String turn = segment.getTurnType().toString();
|
String turn = segment.getTurnType().toString();
|
||||||
final int[] lns = segment.getTurnType().getLanes();
|
final int[] lns = segment.getTurnType().getLanes();
|
||||||
if (lns != null) {
|
if (lns != null) {
|
||||||
|
|
Loading…
Reference in a new issue