aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-10-26 07:02:37 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-10-26 07:02:37 +0200
commiteabe04c65df12e1ceeb9874a509729350932cc93 (patch)
tree8f288f1e3896e7d491a0ddc06784b80a6431695e /tests
parent2754b2aa2f4786bc1d79f36cece46163adda578a (diff)
downloadcgeo-eabe04c65df12e1ceeb9874a509729350932cc93.zip
cgeo-eabe04c65df12e1ceeb9874a509729350932cc93.tar.gz
cgeo-eabe04c65df12e1ceeb9874a509729350932cc93.tar.bz2
add test for okapi loading
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/connector/oc/OkapiClientTest.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/connector/oc/OkapiClientTest.java b/tests/src/cgeo/geocaching/connector/oc/OkapiClientTest.java
index eb797c2..aabf1ec 100644
--- a/tests/src/cgeo/geocaching/connector/oc/OkapiClientTest.java
+++ b/tests/src/cgeo/geocaching/connector/oc/OkapiClientTest.java
@@ -1,8 +1,8 @@
package cgeo.geocaching.connector.oc;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.Geocache;
import cgeo.geocaching.DataStore;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.LoadFlags;
public class OkapiClientTest extends CGeoTestCase {
@@ -28,4 +28,20 @@ public class OkapiClientTest extends CGeoTestCase {
assertNotNull("You must have a valid OKAPI key installed for running this test (but you do not need to set credentials in the app).", cache);
assertEquals("Wupper-Schein", cache.getName());
}
+
+ public static void testOCCacheWithWaypoints() {
+ final String geoCode = "OCDDD2";
+ removeCacheCompletely(geoCode);
+ Geocache cache = OkapiClient.getCache(geoCode);
+ assertNotNull("Did not get cache from OKAPI", cache);
+ // cache should be stored to DB (to listID 0) when loaded above
+ cache = DataStore.loadCache(geoCode, LoadFlags.LOAD_ALL_DB_ONLY);
+ assertNotNull(cache);
+ assertEquals(3, cache.getWaypoints().size());
+
+ // load again
+ cache.refresh(cache.getListId(), null);
+ assertEquals(3, cache.getWaypoints().size());
+ }
+
}