Update tests
This commit is contained in:
parent
2941e14932
commit
46a8ce682e
8 changed files with 6 additions and 10 deletions
|
@ -12,8 +12,8 @@
|
||||||
<classpathentry kind="lib" path="libs/tuprolog.jar"/>
|
<classpathentry kind="lib" path="libs/tuprolog.jar"/>
|
||||||
<classpathentry kind="lib" path="libs/icu4j-49_1_patched.jar"/>
|
<classpathentry kind="lib" path="libs/icu4j-49_1_patched.jar"/>
|
||||||
<classpathentry kind="lib" path="libs/gnu-trove-osmand.jar"/>
|
<classpathentry kind="lib" path="libs/gnu-trove-osmand.jar"/>
|
||||||
<classpathentry kind="lib" path="test-libs/gson-2.6.2.jar"/>
|
<classpathentry kind="lib" path="test/libs/gson-2.6.2.jar"/>
|
||||||
<classpathentry kind="lib" path="test-libs/hamcrest-core-1.3.jar"/>
|
<classpathentry kind="lib" path="test/libs/hamcrest-core-1.3.jar"/>
|
||||||
<classpathentry kind="lib" path="test-libs/junit-4.12.jar"/>
|
<classpathentry kind="lib" path="test/libs/junit-4.12.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<property name="test.lib.dir" value="test-libs" />
|
<property name="test.lib.dir" value="test-libs" />
|
||||||
<property name="test.lib.absolute.dir" location="${test.lib.dir}" />
|
<property name="test.lib.absolute.dir" location="${test.lib.dir}" />
|
||||||
<property name="reports.tests" value="${basedir}/test-results" />
|
<property name="reports.tests" value="${basedir}/test-results" />
|
||||||
|
<property name="srctests.dir" value="test/java"/>
|
||||||
<property name="java.encoding" value="UTF-8" />
|
<property name="java.encoding" value="UTF-8" />
|
||||||
|
|
||||||
<path id="build.path">
|
<path id="build.path">
|
||||||
|
|
|
@ -6,5 +6,5 @@ if [ ! -d bin ];
|
||||||
ant build
|
ant build
|
||||||
fi
|
fi
|
||||||
echo "Starting tests..."
|
echo "Starting tests..."
|
||||||
ant run-turn-lanes-test
|
ant junits
|
||||||
echo "Results can be found in result.txt file."
|
echo "Results can be found in result.txt file."
|
|
@ -64,7 +64,7 @@ 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 {
|
||||||
|
|
||||||
String fileName = "test_turn_lanes.json";
|
String fileName = "test/resources/test_turn_lanes.json";
|
||||||
|
|
||||||
Reader reader = new FileReader(fileName);
|
Reader reader = new FileReader(fileName);
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
@ -101,8 +101,6 @@ public class RouteResultPreparationTest {
|
||||||
String expectedResult = expectedResults.get(segmentId);
|
String expectedResult = expectedResults.get(segmentId);
|
||||||
if (expectedResult != null) {
|
if (expectedResult != null) {
|
||||||
Assert.assertEquals("Segment " + segmentId, expectedResult, lanes);
|
Assert.assertEquals("Segment " + segmentId, expectedResult, lanes);
|
||||||
} else {
|
|
||||||
//TODO: action if needed when expectedResults is null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("segmentId: " + segmentId + " description: " + name);
|
System.out.println("segmentId: " + segmentId + " description: " + name);
|
||||||
|
@ -125,7 +123,6 @@ public class RouteResultPreparationTest {
|
||||||
|
|
||||||
|
|
||||||
private String getLanesString(RouteSegmentResult segment) {
|
private String getLanesString(RouteSegmentResult segment) {
|
||||||
String turn = segment.getTurnType().toString();
|
|
||||||
final int[] lns = segment.getTurnType().getLanes();
|
final int[] lns = segment.getTurnType().getLanes();
|
||||||
if (lns != null) {
|
if (lns != null) {
|
||||||
String s = "";
|
String s = "";
|
||||||
|
@ -152,7 +149,6 @@ public class RouteResultPreparationTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
s += "";
|
s += "";
|
||||||
turn += s;
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue