diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-06-08 10:35:47 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-06-08 10:35:47 +0200 |
| commit | 934945bddf33ec77ee77daff1add6498fe08e400 (patch) | |
| tree | 73542a8f4901399cd95c5497e5a72d3d493c3aaa /tests | |
| parent | 97df73c9ca484902a5ab2744c7c5beb57d550b42 (diff) | |
| download | cgeo-934945bddf33ec77ee77daff1add6498fe08e400.zip cgeo-934945bddf33ec77ee77daff1add6498fe08e400.tar.gz cgeo-934945bddf33ec77ee77daff1add6498fe08e400.tar.bz2 | |
fix #2841: *.loc from waymarking not imported
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/res/raw/waymarking_loc.loc | 8 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/LocParserTest.java | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/res/raw/waymarking_loc.loc b/tests/res/raw/waymarking_loc.loc new file mode 100644 index 0000000..caf3f7f --- /dev/null +++ b/tests/res/raw/waymarking_loc.loc @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<loc version="1.0" src="Groundspeak, Inc.">
+<waypoint>
+ <name id="WM7BK7"><![CDATA[Römerstrasse Kornwestheim by travelling]]></name>
+ <coord lat="48.856733" lon="9.197683"/>
+ <type>Waymark|Ancient Roman Civilization</type>
+ <link text="Waymark Details">http://www.waymarking.com/waymarks/WM7BK7_Rmerstrasse_Kornwestheim</link>
+</waypoint></loc>
\ No newline at end of file diff --git a/tests/src/cgeo/geocaching/files/LocParserTest.java b/tests/src/cgeo/geocaching/files/LocParserTest.java index bcc8e78..6e00b35 100644 --- a/tests/src/cgeo/geocaching/files/LocParserTest.java +++ b/tests/src/cgeo/geocaching/files/LocParserTest.java @@ -2,6 +2,7 @@ package cgeo.geocaching.files; import cgeo.geocaching.Geocache; import cgeo.geocaching.enumerations.CacheSize; +import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase; import cgeo.geocaching.test.R; @@ -35,6 +36,7 @@ public class LocParserTest extends AbstractResourceInstrumentationTestCase { assertNotNull(cache); assertEquals("OC5952", cache.getGeocode()); assertEquals("Die Schatzinsel / treasure island", cache.getName()); + assertEquals("Die unbesiegbaren Geo - Geparden", cache.getOwnerDisplayName()); assertEquals(new Geopoint(48.85968, 9.18740), cache.getCoords()); } @@ -45,9 +47,26 @@ public class LocParserTest extends AbstractResourceInstrumentationTestCase { assertNotNull(cache); assertEquals("GC1BKP3", cache.getGeocode()); assertEquals("Die Schatzinsel / treasure island", cache.getName()); + assertEquals("Die unbesiegbaren Geo - Geparden", cache.getOwnerDisplayName()); assertEquals(new Geopoint(48.859683, 9.1874), cache.getCoords()); assertEquals(1.0f, cache.getDifficulty()); assertEquals(5.0f, cache.getTerrain()); assertEquals(CacheSize.MICRO, cache.getSize()); } + + public void testWaymarkingLoc() throws IOException, ParserException { + final List<Geocache> waymarks = readLoc(R.raw.waymarking_loc); + assertEquals(1, waymarks.size()); + final Geocache waymark = waymarks.get(0); + assertNotNull(waymark); + assertEquals("WM7BK7", waymark.getGeocode()); + assertEquals("Römerstrasse Kornwestheim", waymark.getName()); + assertEquals("travelling", waymark.getOwnerDisplayName()); + assertEquals(new Geopoint(48.856733, 9.197683), waymark.getCoords()); + // links are not yet stored for single caches + // assertEquals("http://www.waymarking.com/waymarks/WM7BK7_Rmerstrasse_Kornwestheim", waymark.getUrl()); + assertEquals(CacheSize.UNKNOWN, waymark.getSize()); + assertEquals(CacheType.UNKNOWN, waymark.getType()); + } + } |
