aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-12-16 11:38:42 +0100
committerBananeweizen <bananeweizen@gmx.de>2012-12-16 11:38:42 +0100
commit55c54fc29a7deaf9300001dfb136e0475261e84d (patch)
treee8f82b8fccac10794488fd097dc1801ee591cf22 /tests/src/cgeo/geocaching
parentf25be2fc05a0e8143bdf7c82886289d46bc2153c (diff)
downloadcgeo-55c54fc29a7deaf9300001dfb136e0475261e84d.zip
cgeo-55c54fc29a7deaf9300001dfb136e0475261e84d.tar.gz
cgeo-55c54fc29a7deaf9300001dfb136e0475261e84d.tar.bz2
refactoring: 3 tests fail if cache type is not ALL
Diffstat (limited to 'tests/src/cgeo/geocaching')
-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);
}
}