From 684e8419fb4fa0f38fe9a1fd3b474a853a274484 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sun, 24 Feb 2013 10:25:43 +0100 Subject: code cleanup * rename several lower case classes * more strict visibility modifiers * Lint warnings * style warnings --- tests/src/cgeo/geocaching/cgeoApplicationTest.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/src/cgeo/geocaching/cgeoApplicationTest.java') diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java index 8556abf..c1b01e7 100644 --- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java +++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java @@ -56,7 +56,7 @@ public class cgeoApplicationTest extends CGeoTestCase { */ @MediumTest public static void testSearchTrackableNotExisting() { - Trackable tb = GCParser.searchTrackable("123456", null, null); + final Trackable tb = GCParser.searchTrackable("123456", null, null); assertNull(tb); } @@ -130,8 +130,8 @@ public class cgeoApplicationTest extends CGeoTestCase { */ @MediumTest public static void testSearchByGeocodeNotLoggedIn() { - ImmutablePair login = Settings.getLogin(); - String memberStatus = Settings.getMemberStatus(); + final ImmutablePair login = Settings.getLogin(); + final String memberStatus = Settings.getMemberStatus(); try { // non premium cache @@ -143,7 +143,7 @@ public class cgeoApplicationTest extends CGeoTestCase { assertNotNull(search); assertEquals(1, search.getGeocodes().size()); assertTrue(search.getGeocodes().contains(cache.getGeocode())); - Geocache searchedCache = search.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB); + final Geocache searchedCache = search.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB); // coords must be null if the user is not logged in assertNull(searchedCache.getCoords()); @@ -169,16 +169,16 @@ public class cgeoApplicationTest extends CGeoTestCase { */ @MediumTest public static void testSearchErrorOccured() { - ImmutablePair login = Settings.getLogin(); - String memberStatus = Settings.getMemberStatus(); + final ImmutablePair login = Settings.getLogin(); + final String memberStatus = Settings.getMemberStatus(); try { // non premium cache - MockedCache cache = new GC1ZXX2(); + final MockedCache cache = new GC1ZXX2(); deleteCacheFromDBAndLogout(cache.getGeocode()); - SearchResult search = Geocache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null); + final SearchResult search = Geocache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null); assertNotNull(search); assertEquals(0, search.getGeocodes().size()); @@ -325,10 +325,10 @@ public class cgeoApplicationTest extends CGeoTestCase { @MediumTest public static void testSearchByViewportNotLoggedIn() { - ImmutablePair login = Settings.getLogin(); - String memberStatus = Settings.getMemberStatus(); - Strategy strategy = Settings.getLiveMapStrategy(); - Strategy testStrategy = Strategy.FAST; // FASTEST, FAST or DETAILED for tests + final ImmutablePair login = Settings.getLogin(); + final String memberStatus = Settings.getMemberStatus(); + final Strategy strategy = Settings.getLiveMapStrategy(); + final Strategy testStrategy = Strategy.FAST; // FASTEST, FAST or DETAILED for tests Settings.setLiveMapStrategy(testStrategy); final CacheType cacheType = Settings.getCacheType(); @@ -348,7 +348,7 @@ public class cgeoApplicationTest extends CGeoTestCase { assertNotNull(search); assertTrue(search.getGeocodes().contains(cache.getGeocode())); // coords differ - Geocache cacheFromViewport = cgData.loadCache(cache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB); + final Geocache 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)); @@ -398,10 +398,10 @@ public class cgeoApplicationTest extends CGeoTestCase { * Caches that are good test cases */ public static void testSearchByGeocodeSpecialties() { - Geocache GCV2R9 = cgeoApplicationTest.testSearchByGeocode("GCV2R9"); + final Geocache GCV2R9 = cgeoApplicationTest.testSearchByGeocode("GCV2R9"); Assert.assertEquals("California, United States", GCV2R9.getLocation()); - Geocache GC1ZXEZ = cgeoApplicationTest.testSearchByGeocode("GC1ZXEZ"); + final Geocache GC1ZXEZ = cgeoApplicationTest.testSearchByGeocode("GC1ZXEZ"); Assert.assertEquals("Ms.Marple/Mr.Stringer", GC1ZXEZ.getOwnerUserId()); } -- cgit v1.1