aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/cgeoApplicationTest.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-12-01 11:17:28 +0100
committerBananeweizen <bananeweizen@gmx.de>2012-12-01 11:17:28 +0100
commit9e8bd582fe704f06414f4018da65a49976511541 (patch)
tree4d40f1247b311ad20ea686fb12deb2261fc5e036 /tests/src/cgeo/geocaching/cgeoApplicationTest.java
parent2a399517f9bbd58fdd1f9bb79bac08ef5d1d344d (diff)
downloadcgeo-9e8bd582fe704f06414f4018da65a49976511541.zip
cgeo-9e8bd582fe704f06414f4018da65a49976511541.tar.gz
cgeo-9e8bd582fe704f06414f4018da65a49976511541.tar.bz2
fix #2211: remove application-database indirection
Diffstat (limited to 'tests/src/cgeo/geocaching/cgeoApplicationTest.java')
-rw-r--r--tests/src/cgeo/geocaching/cgeoApplicationTest.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
index f7d3158..32cbe40 100644
--- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java
+++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
@@ -109,7 +109,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
if (Settings.isPremiumMember() || search.getError() == null) {
assertEquals(1, search.getGeocodes().size());
assertTrue(search.getGeocodes().contains(geocode));
- return cgeoapplication.getInstance().loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
+ return cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
}
assertEquals(0, search.getGeocodes().size());
return null;
@@ -279,8 +279,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
SearchResult search = ConnectorFactory.searchByViewport(viewport, tokens);
assertNotNull(search);
assertTrue(search.getGeocodes().contains(mockedCache.getGeocode()));
-
- cgCache parsedCache = cgeoapplication.getInstance().loadCache(mockedCache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
+ cgCache parsedCache = cgData.loadCache(mockedCache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
assertEquals(Settings.isPremiumMember(), mockedCache.getCoords().equals(parsedCache.getCoords()));
assertEquals(Settings.isPremiumMember(), parsedCache.isReliableLatLon());
@@ -292,8 +291,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
search = ConnectorFactory.searchByViewport(viewport, tokens);
assertNotNull(search);
assertTrue(search.getGeocodes().contains(mockedCache.getGeocode()));
-
- parsedCache = cgeoapplication.getInstance().loadCache(mockedCache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
+ parsedCache = cgData.loadCache(mockedCache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
assertEquals(Settings.isPremiumMember(), mockedCache.getCoords().equals(parsedCache.getCoords()));
assertEquals(Settings.isPremiumMember(), parsedCache.isReliableLatLon());
@@ -332,7 +330,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
assertNotNull(search);
assertTrue(search.getGeocodes().contains(cache.getGeocode()));
// coords differ
- cgCache cacheFromViewport = cgeoapplication.getInstance().loadCache(cache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
+ cgCache cacheFromViewport = cgData.loadCache(cache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
Log.d("cgeoApplicationTest.testSearchByViewportNotLoggedIn: Coords expected = " + cache.getCoords());
Log.d("cgeoApplicationTest.testSearchByViewportNotLoggedIn: Coords actual = " + cacheFromViewport.getCoords());
assertFalse(cache.getCoords().isEqualTo(cacheFromViewport.getCoords(), 1e-3));
@@ -390,7 +388,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
/** Remove cache from DB and cache to ensure that the cache is not loaded from the database */
private static void deleteCacheFromDB(String geocode) {
- cgeoapplication.getInstance().removeCache(geocode, LoadFlags.REMOVE_ALL);
+ cgData.removeCache(geocode, LoadFlags.REMOVE_ALL);
}
/** Remove cache from DB and cache to ensure that the cache is not loaded from the database */