aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/CgeoApplicationTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/CgeoApplicationTest.java')
-rw-r--r--tests/src/cgeo/geocaching/CgeoApplicationTest.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/src/cgeo/geocaching/CgeoApplicationTest.java b/tests/src/cgeo/geocaching/CgeoApplicationTest.java
index ebe317d..6763d7b 100644
--- a/tests/src/cgeo/geocaching/CgeoApplicationTest.java
+++ b/tests/src/cgeo/geocaching/CgeoApplicationTest.java
@@ -16,7 +16,7 @@ import cgeo.geocaching.list.StoredList;
import cgeo.geocaching.loaders.RecaptchaReceiver;
import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.location.Viewport;
-import cgeo.geocaching.maps.LiveMapStrategy.Strategy;
+import cgeo.geocaching.maps.LivemapStrategy;
import cgeo.geocaching.settings.Settings;
import cgeo.geocaching.settings.TestSettings;
import cgeo.geocaching.test.RegExPerformanceTest;
@@ -95,7 +95,7 @@ public class CgeoApplicationTest extends CGeoTestCase {
// no assumption possible: assertThat(tb.getSpottedName()).isEqualTo("Nice place for a break cache");
// we can't check specifics in the log entries since they change, but we can verify data was parsed
- for (LogEntry log : tb.getLogs()) {
+ for (final LogEntry log : tb.getLogs()) {
assertThat(log.date).isGreaterThan(0);
assertThat(log.author).isNotEmpty();
if (log.type == LogType.PLACED_IT || log.type == LogType.RETRIEVED_IT) {
@@ -136,7 +136,6 @@ public class CgeoApplicationTest extends CGeoTestCase {
/**
* Set the login data to the cgeo login, run the given Runnable, and restore the login.
*
- * @param runnable
*/
private static void withMockedLoginDo(final Runnable runnable) {
final ImmutablePair<String, String> login = Settings.getGcCredentials();
@@ -212,9 +211,8 @@ public class CgeoApplicationTest extends CGeoTestCase {
/**
* mock the "exclude disabled caches" and "exclude my caches" options for the execution of the runnable
*
- * @param runnable
*/
- private static void withMockedFilters(Runnable runnable) {
+ private static void withMockedFilters(final Runnable runnable) {
// backup user settings
final boolean excludeMine = Settings.isExcludeMyCaches();
final boolean excludeDisabled = Settings.isExcludeDisabledCaches();
@@ -293,7 +291,7 @@ public class CgeoApplicationTest extends CGeoTestCase {
@Override
public void run() {
// backup user settings
- final Strategy strategy = Settings.getLiveMapStrategy();
+ final LivemapStrategy strategy = Settings.getLiveMapStrategy();
final CacheType cacheType = Settings.getCacheType();
try {
@@ -308,7 +306,7 @@ public class CgeoApplicationTest extends CGeoTestCase {
final Viewport viewport = new Viewport(mockedCache, 0.003, 0.003);
// check coords for DETAILED
- Settings.setLiveMapStrategy(Strategy.DETAILED);
+ Settings.setLiveMapStrategy(LivemapStrategy.DETAILED);
SearchResult search = ConnectorFactory.searchByViewport(viewport, tokens);
assertThat(search).isNotNull();
assertThat(search.getGeocodes().contains(mockedCache.getGeocode())).isTrue();
@@ -320,7 +318,7 @@ public class CgeoApplicationTest extends CGeoTestCase {
assertThat(parsedCache.isReliableLatLon()).isEqualTo(Settings.isGCPremiumMember());
// check update after switch strategy to FAST
- Settings.setLiveMapStrategy(Strategy.FAST);
+ Settings.setLiveMapStrategy(LivemapStrategy.FAST);
Tile.cache.removeFromTileCache(mockedCache);
search = ConnectorFactory.searchByViewport(viewport, tokens);
@@ -351,8 +349,8 @@ public class CgeoApplicationTest extends CGeoTestCase {
@Override
public void run() {
- final Strategy strategy = Settings.getLiveMapStrategy();
- final Strategy testStrategy = Strategy.FAST; // FASTEST, FAST or DETAILED for tests
+ final LivemapStrategy strategy = Settings.getLiveMapStrategy();
+ final LivemapStrategy testStrategy = LivemapStrategy.FAST; // FASTEST, FAST or DETAILED for tests
Settings.setLiveMapStrategy(testStrategy);
final CacheType cacheType = Settings.getCacheType();
@@ -377,7 +375,7 @@ public class CgeoApplicationTest extends CGeoTestCase {
Log.d("cgeoApplicationTest.testSearchByViewportNotLoggedIn: Coords actual = " + cacheFromViewport.getCoords());
assertThat(cache.getCoords().distanceTo(cacheFromViewport.getCoords()) <= 1e-3).isFalse();
// depending on the chosen strategy the coords can be reliable or not
- assertThat(cacheFromViewport.isReliableLatLon()).isEqualTo(testStrategy == Strategy.DETAILED);
+ assertThat(cacheFromViewport.isReliableLatLon()).isEqualTo(testStrategy == LivemapStrategy.DETAILED);
// premium cache
cache = new GC2JVEH();
@@ -402,7 +400,7 @@ public class CgeoApplicationTest extends CGeoTestCase {
* Test cache parsing. Esp. useful after a GC.com update
*/
public static void testSearchByGeocodeBasis() {
- for (MockedCache mockedCache : RegExPerformanceTest.MOCKED_CACHES) {
+ for (final MockedCache mockedCache : RegExPerformanceTest.MOCKED_CACHES) {
final String oldUser = mockedCache.getMockedDataUser();
try {
mockedCache.setMockedDataUser(Settings.getUsername());
@@ -426,7 +424,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 deleteCacheFromDBAndLogout(String geocode) {
+ private static void deleteCacheFromDBAndLogout(final String geocode) {
deleteCacheFromDB(geocode);
GCLogin.getInstance().logout();