KMLImporter: added test.

This commit is contained in:
Dennis Guse
2021-06-01 19:11:14 +02:00
parent 5b2d9a5773
commit 6334dcea04
2 changed files with 30 additions and 0 deletions
@@ -177,4 +177,15 @@ public class KMLImportTest {
// when
importTrackId = importer.importFile(inputStream).get(0);
}
@LargeTest
@Test(expected = ImportParserException.class)
public void kml_when_locations_different() throws IOException {
// given
XMLImporter importer = new XMLImporter(new KmlTrackImporter(context, trackImporter));
InputStream inputStream = InstrumentationRegistry.getInstrumentation().getContext().getResources().openRawResource(de.dennisguse.opentracks.debug.test.R.raw.kml22_when_locations_different);
// when
importTrackId = importer.importFile(inputStream).get(0);
}
}
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:gx="http://www.google.com/kml/ext/2.2"
xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<gx:MultiTrack>
<altitudeMode>absolute</altitudeMode>
<gx:interpolate>1</gx:interpolate>
<gx:Track>
<when>2021-05-29T18:06:21.767Z</when>
<gx:coord />
<gx:coord>14.0 3.0 10.0</gx:coord>
</gx:Track>
</gx:MultiTrack>
</Placemark>
</Document>
</kml>