aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/cgeo/geocaching/cgeoApplicationTest.java6
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/GCConnectorTest.java4
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
index 32cbe40..5e23d98 100644
--- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java
+++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
@@ -263,10 +263,12 @@ public class cgeoApplicationTest extends CGeoTestCase {
// backup user settings
final boolean excludeMine = Settings.isExcludeMyCaches();
final Strategy strategy = Settings.getLiveMapStrategy();
+ final CacheType cacheType = Settings.getCacheType();
try {
// set up settings required for test
Settings.setExcludeMine(false);
+ Settings.setCacheType(CacheType.ALL);
final GC2CJPF mockedCache = new GC2CJPF();
deleteCacheFromDB(mockedCache.getGeocode());
@@ -300,6 +302,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
// restore user settings
Settings.setExcludeMine(excludeMine);
Settings.setLiveMapStrategy(strategy);
+ Settings.setCacheType(cacheType);
}
}
@@ -314,6 +317,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
Strategy strategy = Settings.getLiveMapStrategy();
Strategy testStrategy = Strategy.FAST; // FASTEST, FAST or DETAILED for tests
Settings.setLiveMapStrategy(testStrategy);
+ final CacheType cacheType = Settings.getCacheType();
try {
@@ -323,6 +327,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
MockedCache cache = new GC2CJPF();
deleteCacheFromDBAndLogout(cache.getGeocode());
Tile.Cache.removeFromTileCache(cache);
+ Settings.setCacheType(CacheType.ALL);
Viewport viewport = new Viewport(cache, 0.003, 0.003);
SearchResult search = ConnectorFactory.searchByViewport(viewport, tokens);
@@ -354,6 +359,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
Settings.setMemberStatus(memberStatus);
Login.login();
Settings.setLiveMapStrategy(strategy);
+ Settings.setCacheType(cacheType);
}
}
diff --git a/tests/src/cgeo/geocaching/connector/gc/GCConnectorTest.java b/tests/src/cgeo/geocaching/connector/gc/GCConnectorTest.java
index ea46bbe..ec5ebe2 100644
--- a/tests/src/cgeo/geocaching/connector/gc/GCConnectorTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/GCConnectorTest.java
@@ -3,6 +3,7 @@ package cgeo.geocaching.connector.gc;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
import cgeo.geocaching.connector.ConnectorFactory;
+import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.Viewport;
import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase;
@@ -12,9 +13,11 @@ public class GCConnectorTest extends AbstractResourceInstrumentationTestCase {
public static void testGetViewport() {
// backup user settings
final boolean excludeMine = Settings.isExcludeMyCaches();
+ final CacheType cacheType = Settings.getCacheType();
try {
// set up settings required for test
Settings.setExcludeMine(false);
+ Settings.setCacheType(CacheType.ALL);
Login.login();
String[] tokens = Login.getMapTokens();
@@ -37,6 +40,7 @@ public class GCConnectorTest extends AbstractResourceInstrumentationTestCase {
} finally {
// restore user settings
Settings.setExcludeMine(excludeMine);
+ Settings.setCacheType(cacheType);
}
}