diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/res/raw/waymarking_gpx.gpx | 20 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/res/raw/waymarking_gpx.gpx b/tests/res/raw/waymarking_gpx.gpx new file mode 100644 index 0000000..5f93da9 --- /dev/null +++ b/tests/res/raw/waymarking_gpx.gpx @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?>
+<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" creator="Groundspeak, Inc. All Rights Reserved. http://www.groundspeak.com" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd" xmlns="http://www.topografix.com/GPX/1/0">
+ <name>GPX Lite Waymark List Generated from Waymarking.com</name>
+ <desc>A list of waymarks generated from Waymarking.com</desc>
+ <author />
+ <email>contact@waymarking.com</email>
+ <url>http://www.waymarking.com</url>
+ <urlname>Waymarking - Unique and Interesting Locations</urlname>
+ <time>2013-06-08T07:06:36.3821125Z</time>
+ <keywords>waymark</keywords>
+ <bounds minlat="48.86422" minlon="9.1836" maxlat="48.86422" maxlon="9.1836" />
+ <wpt lat="48.86422" lon="9.1836">
+ <name>WM7BM7</name>
+ <desc>Roman water pipe Kornwestheim - A water fountain from an originally Roman water pipe.</desc>
+ <url>http://www.waymarking.com/waymarks/WM7BM7_Roman_water_pipe_Kornwestheim</url>
+ <urlname>Roman water pipe Kornwestheim</urlname>
+ <sym>Waymark</sym>
+ <type>Ancient Roman Civilization</type>
+ </wpt>
+</gpx>
\ No newline at end of file diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index 8fd962e..5732f9a 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -13,6 +13,8 @@ import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; import cgeo.geocaching.test.R; +import org.apache.commons.lang3.StringUtils; + import java.io.IOException; import java.io.InputStream; import java.text.ParseException; @@ -281,4 +283,16 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { removeCacheCompletely(geocode); } + public void testWaymarking() throws Exception { + final List<Geocache> caches = readGPX10(R.raw.waymarking_gpx); + assertEquals(1, caches.size()); + final Geocache waymark = caches.get(0); + assertNotNull(waymark); + assertEquals("WM7BM7", waymark.getGeocode()); + assertEquals("Roman water pipe Kornwestheim", waymark.getName()); + assertTrue(StringUtils.isNotBlank(waymark.getUrl())); // connector must be able to create it + assertEquals(CacheType.UNKNOWN, waymark.getType()); + assertEquals(CacheSize.UNKNOWN, waymark.getSize()); + } + } |
