Added noData parameter to search tests
This commit is contained in:
parent
86378cbc93
commit
820dbaec0e
1 changed files with 19 additions and 14 deletions
|
@ -114,7 +114,9 @@ public class SearchUICoreTest {
|
|||
}
|
||||
}
|
||||
JSONObject settingsJson = sourceJson.getJSONObject("settings");
|
||||
|
||||
BinaryMapIndexReader reader = null;
|
||||
boolean useData = settingsJson.optBoolean("useData", true);
|
||||
if (useData) {
|
||||
boolean obfZipFileExists = obfZipFile.exists();
|
||||
if (!obfZipFileExists) {
|
||||
System.out.println(String.format("Could not find obf file: %s", obfZipFile.getPath()));
|
||||
|
@ -128,7 +130,8 @@ public class SearchUICoreTest {
|
|||
fous.close();
|
||||
gzin.close();
|
||||
|
||||
BinaryMapIndexReader reader = new BinaryMapIndexReader(new RandomAccessFile(obfFile.getPath(), "r"), obfFile);
|
||||
reader = new BinaryMapIndexReader(new RandomAccessFile(obfFile.getPath(), "r"), obfFile);
|
||||
}
|
||||
List<List<String>> results = new ArrayList<>();
|
||||
for (int i = 0; i < phrases.size(); i++) {
|
||||
results.add(new ArrayList<String>());
|
||||
|
@ -146,7 +149,9 @@ public class SearchUICoreTest {
|
|||
}
|
||||
|
||||
SearchSettings s = SearchSettings.parseJSON(settingsJson);
|
||||
if (reader != null) {
|
||||
s.setOfflineIndexes(Collections.singletonList(reader));
|
||||
}
|
||||
|
||||
final SearchUICore core = new SearchUICore(MapPoiTypes.getDefault(), "en", false);
|
||||
core.init();
|
||||
|
|
Loading…
Reference in a new issue