test added

This commit is contained in:
simon 2020-09-22 17:32:25 +03:00
parent 5252d179d0
commit 71827daeea

View file

@ -46,11 +46,11 @@ public class RouteTestingTest {
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[]> arrayList = new ArrayList<>(); ArrayList<Object[]> arrayList = new ArrayList<>();
for(TestEntry te : testEntries) { for (TestEntry te : testEntries) {
if(te.isIgnore()) { if (te.isIgnore()) {
continue; continue;
} }
arrayList.add(new Object[] {te.getTestName(), te}); arrayList.add(new Object[]{te.getTestName(), te});
} }
reader.close(); reader.close();
return arrayList; return arrayList;
@ -66,15 +66,14 @@ public class RouteTestingTest {
BinaryMapIndexReader[] binaryMapIndexReaders;// = { new BinaryMapIndexReader(raf, new File(fl)) }; BinaryMapIndexReader[] binaryMapIndexReaders;// = { new BinaryMapIndexReader(raf, new File(fl)) };
RoutingConfiguration.Builder builder = RoutingConfiguration.getDefault(); RoutingConfiguration.Builder builder = RoutingConfiguration.getDefault();
Map<String, String> params = te.getParams(); Map<String, String> params = te.getParams();
if (params.containsKey("map")){ if (params.containsKey("map")) {
String fl1 = "src/test/resources/" + params.get("map"); String fl1 = "src/test/resources/" + params.get("map");
RandomAccessFile raf1 = new RandomAccessFile(fl1, "r"); RandomAccessFile raf1 = new RandomAccessFile(fl1, "r");
binaryMapIndexReaders = new BinaryMapIndexReader[]{ binaryMapIndexReaders = new BinaryMapIndexReader[]{
new BinaryMapIndexReader(raf1, new File(fl1)), new BinaryMapIndexReader(raf1, new File(fl1)),
new BinaryMapIndexReader(raf, new File(fl)) new BinaryMapIndexReader(raf, new File(fl))
}; };
} } else {
else {
binaryMapIndexReaders = new BinaryMapIndexReader[]{new BinaryMapIndexReader(raf, new File(fl))}; binaryMapIndexReaders = new BinaryMapIndexReader[]{new BinaryMapIndexReader(raf, new File(fl))};
} }
RoutingConfiguration config = builder.build(params.containsKey("vehicle") ? params.get("vehicle") : "car", RoutingConfiguration config = builder.build(params.containsKey("vehicle") ? params.get("vehicle") : "car",