aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-05-14 19:43:51 +0200
committerBananeweizen <bananeweizen@gmx.de>2014-05-14 19:43:51 +0200
commitf1ce7876f01fceed22b51e1576b75042daf8d18c (patch)
tree814234b511d537ecacab9921748862423e5522a9 /tests/src
parent3188a7ef866dff3c08c1c2e45c5e87d295461326 (diff)
parent6089f9db35f16797bde5f59c2bcda1d0803cfec6 (diff)
downloadcgeo-f1ce7876f01fceed22b51e1576b75042daf8d18c.zip
cgeo-f1ce7876f01fceed22b51e1576b75042daf8d18c.tar.gz
cgeo-f1ce7876f01fceed22b51e1576b75042daf8d18c.tar.bz2
Merge remote-tracking branch 'origin/release'
Conflicts: main/res/values/changelog_release.xml
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/cgeo/geocaching/files/GPXParserTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java
index e1f3417..08e2662 100644
--- a/tests/src/cgeo/geocaching/files/GPXParserTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java
@@ -106,6 +106,28 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
assertGc31j2hWaypoints(cache);
}
+ public void testRenamedWaypointTypes() throws IOException, ParserException {
+ removeCacheCompletely("GC31J2H");
+ final List<Geocache> caches = readGPX10(R.raw.renamed_waypoints, R.raw.renamed_waypoints_wpts);
+ assertThat(caches).hasSize(25);
+ // multi waypoint (now "physical stage")
+ Geocache cache = caches.get(12);
+ assertThat(cache.getGeocode()).isEqualTo("GC3NBDE");
+ List<Waypoint> waypoints = cache.getWaypoints();
+ assertThat(waypoints).isNotEmpty();
+ Waypoint waypoint = waypoints.get(1);
+ assertThat(waypoint).isNotNull();
+ assertThat(waypoint.getWaypointType()).isEqualTo(WaypointType.STAGE);
+ // mystery waypoint - now "virtual stage"
+ cache = caches.get(15);
+ assertThat(cache.getGeocode()).isEqualTo("GC16CBG");
+ waypoints = cache.getWaypoints();
+ assertThat(waypoints).isNotEmpty();
+ waypoint = waypoints.get(1);
+ assertThat(waypoint).isNotNull();
+ assertThat(waypoint.getWaypointType()).isEqualTo(WaypointType.PUZZLE);
+ }
+
public void testGc31j2hWptsWithoutCache() throws IOException, ParserException {
final List<Geocache> caches = readGPX10(R.raw.gc31j2h_wpts);
assertThat(caches).isEmpty();
@@ -122,6 +144,9 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
assertThat(GPXParser.convertWaypointSym2Type("Reference point")).isEqualTo(WaypointType.WAYPOINT);
assertThat(GPXParser.convertWaypointSym2Type(WaypointType.PARKING.getL10n())).isEqualTo(WaypointType.PARKING);
+ // new names of multi and mystery stages
+ assertThat(GPXParser.convertWaypointSym2Type("Physical Stage")).isEqualTo(WaypointType.STAGE);
+ assertThat(GPXParser.convertWaypointSym2Type("Virtual Stage")).isEqualTo(WaypointType.PUZZLE);
}
private static void assertGc31j2h(final Geocache cache) {