aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2011-11-05 09:48:06 +0100
committerBananeweizen <bananeweizen@gmx.de>2011-11-05 09:48:06 +0100
commit44cdd5e3ce16a0054de9866c6a3ed2848117dffa (patch)
tree72db422005414efbb12680c4f5d31ebc492eb96f /tests/src
parentc42ce76928476441a769e9a48f7d4a0690381cc0 (diff)
downloadcgeo-44cdd5e3ce16a0054de9866c6a3ed2848117dffa.zip
cgeo-44cdd5e3ce16a0054de9866c6a3ed2848117dffa.tar.gz
cgeo-44cdd5e3ce16a0054de9866c6a3ed2848117dffa.tar.bz2
fix GPX import: state field can be empty
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/cgeo/geocaching/files/GPXImporterTest.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
index 720b777..f3d4a88 100644
--- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
@@ -52,7 +52,7 @@ public class GPXImporterTest extends InstrumentationTestCase {
assertEquals(Collections.singletonList("GC31J2H"), search.getGeocodes());
cgCache cache = cgeoapplication.getInstance().getCacheByGeocode("GC31J2H");
- assertNotNull(cache);
+ assertCacheProperties(cache);
// can't assert, for whatever reason the waypoints are remembered in DB
// assertNull(cache.waypoints);
@@ -75,7 +75,7 @@ public class GPXImporterTest extends InstrumentationTestCase {
assertEquals(Collections.singletonList("GC31J2H"), search.getGeocodes());
cgCache cache = cgeoapplication.getInstance().getCacheByGeocode("GC31J2H");
- assertNotNull(cache);
+ assertCacheProperties(cache);
assertEquals(2, cache.getWaypoints().size());
}
@@ -94,7 +94,12 @@ public class GPXImporterTest extends InstrumentationTestCase {
assertEquals(Collections.singletonList("OC5952"), search.getGeocodes());
cgCache cache = cgeoapplication.getInstance().getCacheByGeocode("OC5952");
+ assertCacheProperties(cache);
+ }
+
+ private static void assertCacheProperties(cgCache cache) {
assertNotNull(cache);
+ assertFalse(cache.getLocation().startsWith(","));
}
public void testImportGpxError() throws IOException {