aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-02-03 13:53:48 +0100
committerSamuel Tardieu <sam@rfc1149.net>2013-02-03 13:53:48 +0100
commitb53b6303ae321276d8c25d6a492372ac615580a2 (patch)
treee756bbd1ac81d7117bfadde5c53bb8d5b72d9a85 /tests
parent56106aba18200cd87bc4a51858bdf1125fe913af (diff)
downloadcgeo-b53b6303ae321276d8c25d6a492372ac615580a2.zip
cgeo-b53b6303ae321276d8c25d6a492372ac615580a2.tar.gz
cgeo-b53b6303ae321276d8c25d6a492372ac615580a2.tar.bz2
Refactoring: rename cgCache into Geocache
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/CacheTest.java10
-rw-r--r--tests/src/cgeo/geocaching/cgDataTest.java8
-rw-r--r--tests/src/cgeo/geocaching/cgeoApplicationTest.java24
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/GCBaseTest.java4
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/GCParserTest.java26
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java6
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/WaypointsTest.java6
-rw-r--r--tests/src/cgeo/geocaching/connector/opencaching/OkapiClientTest.java4
-rw-r--r--tests/src/cgeo/geocaching/enumerations/CacheTypeTest.java4
-rw-r--r--tests/src/cgeo/geocaching/export/ExportTest.java4
-rw-r--r--tests/src/cgeo/geocaching/files/GPXImporterTest.java20
-rw-r--r--tests/src/cgeo/geocaching/files/GPXParserTest.java54
-rw-r--r--tests/src/cgeo/geocaching/files/LocParserTest.java16
-rw-r--r--tests/src/cgeo/geocaching/filter/DifficultyFilterTest.java6
-rw-r--r--tests/src/cgeo/geocaching/filter/SizeFilterTest.java12
-rw-r--r--tests/src/cgeo/geocaching/filter/StateArchivedFilterTest.java8
-rw-r--r--tests/src/cgeo/geocaching/filter/StateDisabledFilterTest.java8
-rw-r--r--tests/src/cgeo/geocaching/filter/StateFoundFilterTest.java8
-rw-r--r--tests/src/cgeo/geocaching/filter/StateNonPremiumFilterTest.java8
-rw-r--r--tests/src/cgeo/geocaching/filter/StatePremiumFilterTest.java8
-rw-r--r--tests/src/cgeo/geocaching/filter/TerrainFilterTest.java6
-rw-r--r--tests/src/cgeo/geocaching/filter/TypeFilterTest.java12
-rw-r--r--tests/src/cgeo/geocaching/sorting/DistanceComparatorTest.java6
-rw-r--r--tests/src/cgeo/geocaching/sorting/NameComparatorTest.java8
-rw-r--r--tests/src/cgeo/geocaching/utils/LeastRecentlyUsedMapTest.java14
-rw-r--r--tests/src/cgeo/geocaching/utils/LeastRecentlyUsedSetTest.java12
-rw-r--r--tests/src/cgeo/test/Compare.java4
27 files changed, 153 insertions, 153 deletions
diff --git a/tests/src/cgeo/geocaching/CacheTest.java b/tests/src/cgeo/geocaching/CacheTest.java
index 905cab0..c1279af 100644
--- a/tests/src/cgeo/geocaching/CacheTest.java
+++ b/tests/src/cgeo/geocaching/CacheTest.java
@@ -8,7 +8,7 @@ import java.util.Date;
public class CacheTest extends AndroidTestCase {
- final static private class MockedEventCache extends cgCache {
+ final static private class MockedEventCache extends Geocache {
public MockedEventCache(final Date date) {
setHidden(date);
setType(CacheType.EVENT);
@@ -17,7 +17,7 @@ public class CacheTest extends AndroidTestCase {
public static void testCanBeAddedToCalendar() {
final Date today = new Date();
- final cgCache cacheToday = new MockedEventCache(today);
+ final Geocache cacheToday = new MockedEventCache(today);
assertTrue(cacheToday.canBeAddedToCalendar());
final Date yesterday = new Date(today.getTime() - 86400 * 1000);
@@ -26,8 +26,8 @@ public class CacheTest extends AndroidTestCase {
}
public static void testEquality() {
- final cgCache one = new cgCache();
- final cgCache two = new cgCache();
+ final Geocache one = new Geocache();
+ final Geocache two = new Geocache();
// identity
assertTrue(one.equals(one));
@@ -43,7 +43,7 @@ public class CacheTest extends AndroidTestCase {
}
public static void testGeocodeUppercase() {
- cgCache cache = new cgCache();
+ Geocache cache = new Geocache();
cache.setGeocode("gc1234");
assertEquals("GC1234", cache.getGeocode());
}
diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java
index 1c8a0e0..2d3775d 100644
--- a/tests/src/cgeo/geocaching/cgDataTest.java
+++ b/tests/src/cgeo/geocaching/cgDataTest.java
@@ -22,9 +22,9 @@ public class cgDataTest extends CGeoTestCase {
int listId2 = StoredList.STANDARD_LIST_ID;
// create caches
- final cgCache cache1 = new cgCache();
+ final Geocache cache1 = new Geocache();
cache1.setGeocode("Cache 1");
- final cgCache cache2 = new cgCache();
+ final Geocache cache2 = new Geocache();
cache2.setGeocode("Cache 2");
assertNotNull(cache2);
@@ -104,7 +104,7 @@ public class cgDataTest extends CGeoTestCase {
final String GEOCODE_CACHE = "TEST";
// create cache and trackable
- final cgCache cache = new cgCache();
+ final Geocache cache = new Geocache();
cache.setGeocode(GEOCODE_CACHE);
cache.setDetailed(true);
final Trackable trackable = new Trackable();
@@ -115,7 +115,7 @@ public class cgDataTest extends CGeoTestCase {
try {
cgData.saveCache(cache, EnumSet.of(SaveFlag.SAVE_DB));
- final cgCache loadedCache = cgData.loadCache(GEOCODE_CACHE, LoadFlags.LOAD_ALL_DB_ONLY);
+ final Geocache loadedCache = cgData.loadCache(GEOCODE_CACHE, LoadFlags.LOAD_ALL_DB_ONLY);
assertNotNull("Cache was not saved!", loadedCache);
assertEquals(1, loadedCache.getInventory().size());
} finally {
diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
index fbb860c..8556abf 100644
--- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java
+++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java
@@ -103,8 +103,8 @@ public class cgeoApplicationTest extends CGeoTestCase {
* Test {@link cgBase#searchByGeocode(String, String, int, boolean, CancellableHandler)}
*/
@MediumTest
- public static cgCache testSearchByGeocode(final String geocode) {
- final SearchResult search = cgCache.searchByGeocode(geocode, null, 0, true, null);
+ public static Geocache testSearchByGeocode(final String geocode) {
+ final SearchResult search = Geocache.searchByGeocode(geocode, null, 0, true, null);
assertNotNull(search);
if (Settings.isPremiumMember() || search.getError() == null) {
assertEquals(1, search.getGeocodes().size());
@@ -120,7 +120,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
*/
@MediumTest
public static void testSearchByGeocodeNotExisting() {
- final SearchResult search = cgCache.searchByGeocode("GC123456", null, 0, true, null);
+ final SearchResult search = Geocache.searchByGeocode("GC123456", null, 0, true, null);
assertNotNull(search);
assertEquals(StatusCode.UNPUBLISHED_CACHE, search.getError());
}
@@ -139,11 +139,11 @@ public class cgeoApplicationTest extends CGeoTestCase {
deleteCacheFromDBAndLogout(cache.getGeocode());
- SearchResult search = cgCache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null);
+ SearchResult search = Geocache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null);
assertNotNull(search);
assertEquals(1, search.getGeocodes().size());
assertTrue(search.getGeocodes().contains(cache.getGeocode()));
- cgCache searchedCache = search.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache searchedCache = search.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
// coords must be null if the user is not logged in
assertNull(searchedCache.getCoords());
@@ -152,7 +152,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
deleteCacheFromDBAndLogout(cache.getGeocode());
- search = cgCache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null);
+ search = Geocache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null);
assertNotNull(search);
assertEquals(0, search.getGeocodes().size());
@@ -178,7 +178,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
deleteCacheFromDBAndLogout(cache.getGeocode());
- SearchResult search = cgCache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null);
+ SearchResult search = Geocache.searchByGeocode(cache.getGeocode(), null, StoredList.TEMPORARY_LIST_ID, true, null);
assertNotNull(search);
assertEquals(0, search.getGeocodes().size());
@@ -293,7 +293,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
SearchResult search = ConnectorFactory.searchByViewport(viewport, tokens);
assertNotNull(search);
assertTrue(search.getGeocodes().contains(mockedCache.getGeocode()));
- cgCache parsedCache = cgData.loadCache(mockedCache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache parsedCache = cgData.loadCache(mockedCache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
assertEquals(Settings.isPremiumMember(), mockedCache.getCoords().equals(parsedCache.getCoords()));
assertEquals(Settings.isPremiumMember(), parsedCache.isReliableLatLon());
@@ -348,7 +348,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
assertNotNull(search);
assertTrue(search.getGeocodes().contains(cache.getGeocode()));
// coords differ
- cgCache cacheFromViewport = cgData.loadCache(cache.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
+ 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));
@@ -384,7 +384,7 @@ public class cgeoApplicationTest extends CGeoTestCase {
String oldUser = mockedCache.getMockedDataUser();
try {
mockedCache.setMockedDataUser(Settings.getUsername());
- cgCache parsedCache = cgeoApplicationTest.testSearchByGeocode(mockedCache.getGeocode());
+ Geocache parsedCache = cgeoApplicationTest.testSearchByGeocode(mockedCache.getGeocode());
if (null != parsedCache) {
Compare.assertCompareCaches(mockedCache, parsedCache, true);
}
@@ -398,10 +398,10 @@ public class cgeoApplicationTest extends CGeoTestCase {
* Caches that are good test cases
*/
public static void testSearchByGeocodeSpecialties() {
- cgCache GCV2R9 = cgeoApplicationTest.testSearchByGeocode("GCV2R9");
+ Geocache GCV2R9 = cgeoApplicationTest.testSearchByGeocode("GCV2R9");
Assert.assertEquals("California, United States", GCV2R9.getLocation());
- cgCache GC1ZXEZ = cgeoApplicationTest.testSearchByGeocode("GC1ZXEZ");
+ Geocache GC1ZXEZ = cgeoApplicationTest.testSearchByGeocode("GC1ZXEZ");
Assert.assertEquals("Ms.Marple/Mr.Stringer", GC1ZXEZ.getOwnerUserId());
}
diff --git a/tests/src/cgeo/geocaching/connector/gc/GCBaseTest.java b/tests/src/cgeo/geocaching/connector/gc/GCBaseTest.java
index 91ff2f9..d70ab9b 100644
--- a/tests/src/cgeo/geocaching/connector/gc/GCBaseTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/GCBaseTest.java
@@ -1,7 +1,7 @@
package cgeo.geocaching.connector.gc;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.cgCache;
import cgeo.geocaching.enumerations.LoadFlags;
import cgeo.geocaching.test.mock.GC2CJPF;
import cgeo.geocaching.test.mock.MockedCache;
@@ -34,7 +34,7 @@ public class GCBaseTest extends TestCase {
geocodes.add(mockedCache.getGeocode());
final SearchResult result = GCMap.searchByGeocodes(geocodes);
- final cgCache parsedCache = result.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_ONLY);
+ final Geocache parsedCache = result.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_ONLY);
Compare.assertCompareCaches(mockedCache, parsedCache, false);
diff --git a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java
index 6a49c95..4063ed0 100644
--- a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java
@@ -1,9 +1,9 @@
package cgeo.geocaching.connector.gc;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.Image;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
-import cgeo.geocaching.cgCache;
import cgeo.geocaching.Waypoint;
import cgeo.geocaching.enumerations.LoadFlags;
import cgeo.geocaching.enumerations.StatusCode;
@@ -56,12 +56,12 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
SearchResult result = GCParser.parseCacheFromText(page, null);
assertNotNull(result);
assertEquals(1, result.getCount());
- cgCache cache = result.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = result.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
assertEquals(cacheName, cache.getName());
}
public void testOwnCache() {
- final cgCache cache = parseCache(R.raw.own_cache);
+ final Geocache cache = parseCache(R.raw.own_cache);
assertNotNull(cache);
assertTrue(CollectionUtils.isNotEmpty(cache.getSpoilers()));
assertEquals(1, cache.getSpoilers().size());
@@ -71,7 +71,7 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
assertNull(spoiler.getDescription());
}
- private static cgCache createCache(int index) {
+ private static Geocache createCache(int index) {
final MockedCache mockedCache = RegExPerformanceTest.MOCKED_CACHES.get(index);
// to get the same results we have to use the date format used when the mocked data was created
String oldCustomDate = Settings.getGcCustomDate();
@@ -87,7 +87,7 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
assertNotNull(searchResult);
assertEquals(1, searchResult.getCount());
- final cgCache cache = searchResult.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
+ final Geocache cache = searchResult.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
assertNotNull(cache);
return cache;
}
@@ -104,7 +104,7 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
// to get the same results we have to use the date format used when the mocked data was created
Settings.setGcCustomDate(MockedCache.getDateFormat());
SearchResult searchResult = GCParser.parseCacheFromText(mockedCache.getData(), null);
- cgCache parsedCache = searchResult.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache parsedCache = searchResult.getFirstCacheFromResult(LoadFlags.LOAD_CACHE_OR_DB);
assertTrue(StringUtils.isNotBlank(mockedCache.getMockedDataUser()));
Compare.assertCompareCaches(mockedCache, parsedCache, true);
}
@@ -114,7 +114,7 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
}
public static void testWaypointsFromNote() {
- final cgCache cache = createCache(0);
+ final Geocache cache = createCache(0);
final Geopoint[] empty = new Geopoint[] {};
final Geopoint[] one = new Geopoint[] { new Geopoint("N51 21.523", "E7 2.680") };
@@ -152,24 +152,24 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
@MediumTest
public static void testEditModifiedCoordinates() {
- cgCache cache = new cgCache();
+ Geocache cache = new Geocache();
cache.setGeocode("GC2ZN4G");
// upload coordinates
GCParser.editModifiedCoordinates(cache, new Geopoint("N51 21.544", "E07 02.566"));
cache.drop(new Handler());
String page = GCParser.requestHtmlPage(cache.getGeocode(), null, "n", "0");
- cgCache cache2 = GCParser.parseCacheFromText(page, null).getFirstCacheFromResult(LoadFlags.LOAD_CACHE_ONLY);
+ Geocache cache2 = GCParser.parseCacheFromText(page, null).getFirstCacheFromResult(LoadFlags.LOAD_CACHE_ONLY);
assertTrue(cache2.hasUserModifiedCoords());
assertEquals(new Geopoint("N51 21.544", "E07 02.566"), cache2.getCoords());
// delete coordinates
GCParser.deleteModifiedCoordinates(cache2);
cache2.drop(new Handler());
String page2 = GCParser.requestHtmlPage(cache.getGeocode(), null, "n", "0");
- cgCache cache3 = GCParser.parseCacheFromText(page2, null).getFirstCacheFromResult(LoadFlags.LOAD_CACHE_ONLY);
+ Geocache cache3 = GCParser.parseCacheFromText(page2, null).getFirstCacheFromResult(LoadFlags.LOAD_CACHE_ONLY);
assertFalse(cache3.hasUserModifiedCoords());
}
- private static void assertWaypointsFromNote(final cgCache cache, Geopoint[] expected, String note) {
+ private static void assertWaypointsFromNote(final Geocache cache, Geopoint[] expected, String note) {
cache.setPersonalNote(note);
cache.setWaypoints(new ArrayList<Waypoint>(), false);
cache.parseWaypointsFromNote();
@@ -180,14 +180,14 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase {
}
public void testWaypointParsing() {
- cgCache cache = parseCache(R.raw.gc366bq);
+ Geocache cache = parseCache(R.raw.gc366bq);
assertEquals(13, cache.getWaypoints().size());
//make sure that waypoints are not duplicated
cache = parseCache(R.raw.gc366bq);
assertEquals(13, cache.getWaypoints().size());
}
- private cgCache parseCache(int resourceId) {
+ private Geocache parseCache(int resourceId) {
final String page = getFileContent(resourceId);
SearchResult result = GCParser.parseCacheFromText(page, null);
assertNotNull(result);
diff --git a/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java b/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java
index 0477cc7..42028d8 100644
--- a/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java
@@ -1,6 +1,6 @@
package cgeo.geocaching.connector.gc;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase;
import cgeo.geocaching.test.R;
@@ -29,8 +29,8 @@ public class IconDecoderTest extends AbstractResourceInstrumentationTestCase {
return bitmap;
}
- private static cgCache parseMapPNG(Bitmap bitmap, int x, int y, int zoomlevel) {
- final cgCache cache = new cgCache();
+ private static Geocache parseMapPNG(Bitmap bitmap, int x, int y, int zoomlevel) {
+ final Geocache cache = new Geocache();
cache.setGeocode("GC30");
IconDecoder.parseMapPNG(cache, bitmap, new UTFGridPosition(x / 4, y / 4), zoomlevel);
return cache;
diff --git a/tests/src/cgeo/geocaching/connector/gc/WaypointsTest.java b/tests/src/cgeo/geocaching/connector/gc/WaypointsTest.java
index ca9f8e1..f4b1e0c 100644
--- a/tests/src/cgeo/geocaching/connector/gc/WaypointsTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/WaypointsTest.java
@@ -2,7 +2,7 @@ package cgeo.geocaching.connector.gc;
import cgeo.CGeoTestCase;
import cgeo.geocaching.SearchResult;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.cgData;
import cgeo.geocaching.enumerations.LoadFlags;
import cgeo.geocaching.utils.CancellableHandler;
@@ -18,8 +18,8 @@ public class WaypointsTest extends CGeoTestCase {
}
};
- private static cgCache downloadCache(final String geocode) {
- final SearchResult searchResult = cgCache.searchByGeocode(geocode, null, 0, true, handler);
+ private static Geocache downloadCache(final String geocode) {
+ final SearchResult searchResult = Geocache.searchByGeocode(geocode, null, 0, true, handler);
assertEquals(1, searchResult.getCount());
return searchResult.getFirstCacheFromResult(LoadFlags.LOAD_WAYPOINTS);
}
diff --git a/tests/src/cgeo/geocaching/connector/opencaching/OkapiClientTest.java b/tests/src/cgeo/geocaching/connector/opencaching/OkapiClientTest.java
index 0519b58..130b24d 100644
--- a/tests/src/cgeo/geocaching/connector/opencaching/OkapiClientTest.java
+++ b/tests/src/cgeo/geocaching/connector/opencaching/OkapiClientTest.java
@@ -1,7 +1,7 @@
package cgeo.geocaching.connector.opencaching;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.cgData;
import cgeo.geocaching.connector.oc.OkapiClient;
import cgeo.geocaching.enumerations.LoadFlags;
@@ -10,7 +10,7 @@ public class OkapiClientTest extends CGeoTestCase {
public static void testGetOCCache() {
String geoCode = "OU0331";
- cgCache cache = OkapiClient.getCache(geoCode);
+ Geocache cache = OkapiClient.getCache(geoCode);
assertNotNull(cache);
assertEquals(geoCode, cache.getGeocode());
assertEquals("Oshkosh Municipal Tank", cache.getName());
diff --git a/tests/src/cgeo/geocaching/enumerations/CacheTypeTest.java b/tests/src/cgeo/geocaching/enumerations/CacheTypeTest.java
index fec7652..57d06d4 100644
--- a/tests/src/cgeo/geocaching/enumerations/CacheTypeTest.java
+++ b/tests/src/cgeo/geocaching/enumerations/CacheTypeTest.java
@@ -1,6 +1,6 @@
package cgeo.geocaching.enumerations;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import android.test.AndroidTestCase;
@@ -39,7 +39,7 @@ public class CacheTypeTest extends AndroidTestCase {
}
public static void testContainsCache() throws Exception {
- final cgCache traditional = new cgCache();
+ final Geocache traditional = new Geocache();
traditional.setType(CacheType.TRADITIONAL);
assertTrue(CacheType.ALL.contains(traditional));
diff --git a/tests/src/cgeo/geocaching/export/ExportTest.java b/tests/src/cgeo/geocaching/export/ExportTest.java
index cdd64b2..22c6dd2 100644
--- a/tests/src/cgeo/geocaching/export/ExportTest.java
+++ b/tests/src/cgeo/geocaching/export/ExportTest.java
@@ -1,14 +1,14 @@
package cgeo.geocaching.export;
import cgeo.CGeoTestCase;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.LogEntry;
-import cgeo.geocaching.cgCache;
import cgeo.geocaching.enumerations.LogType;
public class ExportTest extends CGeoTestCase {
public static void testGSAKExport() {
- final cgCache cache = new cgCache();
+ final Geocache cache = new Geocache();
cache.setGeocode("GCX1234");
final LogEntry log = new LogEntry(1353244820000L, LogType.FOUND_IT, "Hidden in a tree");
final StringBuilder logStr = new StringBuilder();
diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
index 8c05ee0..5ece2ee 100644
--- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
@@ -1,8 +1,8 @@
package cgeo.geocaching.files;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
-import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgData;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LoadFlags;
@@ -71,7 +71,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertEquals(GPXImporter.IMPORT_STEP_FINISHED, iMsg.next().what);
SearchResult search = (SearchResult) importStepHandler.messages.get(3).obj;
assertEquals(Collections.singletonList(geocode), new ArrayList<String>(search.getGeocodes()));
- cgCache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
assertTrue(cache.getWaypoints().isEmpty());
@@ -98,7 +98,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertImportStepMessages(GPXImporter.IMPORT_STEP_START, GPXImporter.IMPORT_STEP_READ_FILE, GPXImporter.IMPORT_STEP_READ_WPT_FILE, GPXImporter.IMPORT_STEP_STORE_STATIC_MAPS, GPXImporter.IMPORT_STEP_FINISHED);
SearchResult search = (SearchResult) importStepHandler.messages.get(4).obj;
assertEquals(Collections.singletonList("GC31J2H"), new ArrayList<String>(search.getGeocodes()));
- cgCache cache = cgData.loadCache("GC31J2H", LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = cgData.loadCache("GC31J2H", LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
assertEquals(2, cache.getWaypoints().size());
}
@@ -111,7 +111,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
runImportThread(importThread);
assertImportStepMessages(GPXImporter.IMPORT_STEP_START, GPXImporter.IMPORT_STEP_READ_FILE, GPXImporter.IMPORT_STEP_STORE_STATIC_MAPS, GPXImporter.IMPORT_STEP_FINISHED);
- final cgCache cache = cgData.loadCache("AID1", LoadFlags.LOAD_CACHE_OR_DB);
+ final Geocache cache = cgData.loadCache("AID1", LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
assertEquals("First Aid Station #1", cache.getName());
}
@@ -133,11 +133,11 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertImportStepMessages(GPXImporter.IMPORT_STEP_START, GPXImporter.IMPORT_STEP_READ_FILE, GPXImporter.IMPORT_STEP_STORE_STATIC_MAPS, GPXImporter.IMPORT_STEP_FINISHED);
SearchResult search = (SearchResult) importStepHandler.messages.get(3).obj;
assertEquals(Collections.singletonList("OC5952"), new ArrayList<String>(search.getGeocodes()));
- cgCache cache = cgData.loadCache("OC5952", LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = cgData.loadCache("OC5952", LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
}
- private static void assertCacheProperties(cgCache cache) {
+ private static void assertCacheProperties(Geocache cache) {
assertNotNull(cache);
assertFalse(cache.getLocation().startsWith(","));
assertTrue(cache.isReliableLatLon());
@@ -175,7 +175,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertImportStepMessages(GPXImporter.IMPORT_STEP_START, GPXImporter.IMPORT_STEP_READ_FILE, GPXImporter.IMPORT_STEP_STORE_STATIC_MAPS, GPXImporter.IMPORT_STEP_FINISHED);
SearchResult search = (SearchResult) importStepHandler.messages.get(3).obj;
assertEquals(Collections.singletonList(geocode), new ArrayList<String>(search.getGeocodes()));
- cgCache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
assertTrue(cache.getWaypoints().isEmpty());
@@ -193,7 +193,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertImportStepMessages(GPXImporter.IMPORT_STEP_START, GPXImporter.IMPORT_STEP_READ_FILE, GPXImporter.IMPORT_STEP_READ_WPT_FILE, GPXImporter.IMPORT_STEP_STORE_STATIC_MAPS, GPXImporter.IMPORT_STEP_FINISHED);
SearchResult search = (SearchResult) importStepHandler.messages.get(4).obj;
assertEquals(Collections.singletonList(geocode), new ArrayList<String>(search.getGeocodes()));
- cgCache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
assertEquals(1, cache.getWaypoints().size()); // this is the original pocket query result without test waypoint
}
@@ -219,7 +219,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertImportStepMessages(GPXImporter.IMPORT_STEP_START, GPXImporter.IMPORT_STEP_READ_FILE, GPXImporter.IMPORT_STEP_READ_WPT_FILE, GPXImporter.IMPORT_STEP_STORE_STATIC_MAPS, GPXImporter.IMPORT_STEP_FINISHED);
SearchResult search = (SearchResult) importStepHandler.messages.get(4).obj;
assertEquals(Collections.singletonList(geocode), new ArrayList<String>(search.getGeocodes()));
- cgCache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
+ Geocache cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB);
assertCacheProperties(cache);
assertEquals(1, cache.getWaypoints().size()); // this is the original pocket query result without test waypoint
}
@@ -272,7 +272,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
@Override
protected void tearDown() throws Exception {
SearchResult search = cgData.getBatchOfStoredCaches(null, CacheType.ALL, listId);
- List<cgCache> cachesInList = new ArrayList<cgCache>();
+ List<Geocache> cachesInList = new ArrayList<Geocache>();
cachesInList.addAll(search.getCachesFromSearchResult(LoadFlags.LOAD_CACHE_OR_DB));
cgData.markDropped(cachesInList);
cgData.removeList(listId);
diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java
index ecca308..1849124 100644
--- a/tests/src/cgeo/geocaching/files/GPXParserTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java
@@ -1,9 +1,9 @@
package cgeo.geocaching.files;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.LogEntry;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.StoredList;
-import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgData;
import cgeo.geocaching.Waypoint;
import cgeo.geocaching.enumerations.CacheSize;
@@ -35,11 +35,11 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
testGPXVersion(R.raw.gc1bkp3_gpx100);
}
- private cgCache testGPXVersion(final int resourceId) throws IOException, ParserException {
- final List<cgCache> caches = readGPX10(resourceId);
+ private Geocache testGPXVersion(final int resourceId) throws IOException, ParserException {
+ final List<Geocache> caches = readGPX10(resourceId);
assertNotNull(caches);
assertEquals(1, caches.size());
- final cgCache cache = caches.get(0);
+ final Geocache cache = caches.get(0);
assertEquals("GC1BKP3", cache.getGeocode());
assertEquals("9946f030-a514-46d8-a050-a60e92fd2e1a", cache.getGuid());
assertEquals(CacheType.TRADITIONAL, cache.getType());
@@ -58,14 +58,14 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
}
public void testGPXVersion101() throws IOException, ParserException {
- final cgCache cache = testGPXVersion(R.raw.gc1bkp3_gpx101);
+ final Geocache cache = testGPXVersion(R.raw.gc1bkp3_gpx101);
assertNotNull(cache.getAttributes());
assertEquals(10, cache.getAttributes().size());
}
public void testOC() throws IOException, ParserException {
- final List<cgCache> caches = readGPX10(R.raw.oc5952_gpx);
- final cgCache cache = caches.get(0);
+ final List<Geocache> caches = readGPX10(R.raw.oc5952_gpx);
+ final Geocache cache = caches.get(0);
assertEquals("OC5952", cache.getGeocode());
assertEquals(CacheType.TRADITIONAL, cache.getType());
assertEquals(false, cache.isArchived());
@@ -84,9 +84,9 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
public void testGc31j2h() throws IOException, ParserException {
removeCacheCompletely("GC31J2H");
- final List<cgCache> caches = readGPX10(R.raw.gc31j2h);
+ final List<Geocache> caches = readGPX10(R.raw.gc31j2h);
assertEquals(1, caches.size());
- final cgCache cache = caches.get(0);
+ final Geocache cache = caches.get(0);
assertGc31j2h(cache);
assertSame(cache, caches.get(0));
@@ -98,15 +98,15 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
public void testGc31j2hWpts() throws IOException, ParserException {
removeCacheCompletely("GC31J2H");
- List<cgCache> caches = readGPX10(R.raw.gc31j2h, R.raw.gc31j2h_wpts);
+ List<Geocache> caches = readGPX10(R.raw.gc31j2h, R.raw.gc31j2h_wpts);
assertEquals(1, caches.size());
- cgCache cache = caches.get(0);
+ Geocache cache = caches.get(0);
assertGc31j2h(cache);
assertGc31j2hWaypoints(cache);
}
public void testGc31j2hWptsWithoutCache() throws IOException, ParserException {
- final List<cgCache> caches = readGPX10(R.raw.gc31j2h_wpts);
+ final List<Geocache> caches = readGPX10(R.raw.gc31j2h_wpts);
assertEquals(0, caches.size());
}
@@ -123,7 +123,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
assertEquals(WaypointType.PARKING, GPXParser.convertWaypointSym2Type(WaypointType.PARKING.getL10n()));
}
- private static void assertGc31j2h(final cgCache cache) {
+ private static void assertGc31j2h(final Geocache cache) {
assertEquals("GC31J2H", cache.getGeocode());
assertEquals("Hockenheimer City-Brunnen", cache.getName());
assertTrue("Hockenheimer City-Brunnen by vptsz, Multi-cache (2/1)", cache.getShortDescription().startsWith("Kurzer informativer Multi entlang der Brunnen"));
@@ -164,7 +164,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
}
}
- private static void assertGc31j2hWaypoints(final cgCache cache) {
+ private static void assertGc31j2hWaypoints(final Geocache cache) {
assertNotNull(cache.getWaypoints());
assertEquals(2, cache.getWaypoints().size());
Waypoint wp = cache.getWaypoints().get(0);
@@ -188,24 +188,24 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
assertEquals(8.545100, wp.getCoords().getLongitude(), 0.000001);
}
- private List<cgCache> readGPX10(int... resourceIds) throws IOException, ParserException {
+ private List<Geocache> readGPX10(int... resourceIds) throws IOException, ParserException {
final GPX10Parser parser = new GPX10Parser(listId);
return readVersionedGPX(parser, resourceIds);
}
- private List<cgCache> readGPX11(int... resourceIds) throws IOException, ParserException {
+ private List<Geocache> readGPX11(int... resourceIds) throws IOException, ParserException {
final GPX11Parser parser = new GPX11Parser(listId);
return readVersionedGPX(parser, resourceIds);
}
- private List<cgCache> readVersionedGPX(final GPXParser parser, int... resourceIds) throws IOException, ParserException {
+ private List<Geocache> readVersionedGPX(final GPXParser parser, int... resourceIds) throws IOException, ParserException {
final Set<String> result = new HashSet<String>();
for (int resourceId : resourceIds) {
final InputStream instream = getResourceStream(resourceId);
try {
- Collection<cgCache> caches = parser.parse(instream, null);
+ Collection<Geocache> caches = parser.parse(instream, null);
assertNotNull(caches);
- for (cgCache cache : caches) {
+ for (Geocache cache : caches) {
result.add(cache.getGeocode());
}
} finally {
@@ -213,7 +213,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
}
}
// reload caches, because the parser only returns the minimum version of each cache
- return new ArrayList<cgCache>(cgData.loadCaches(result, LoadFlags.LOAD_ALL_DB_ONLY));
+ return new ArrayList<Geocache>(cgData.loadCaches(result, LoadFlags.LOAD_ALL_DB_ONLY));
}
public static void testParseDateWithFractionalSeconds() throws ParseException {
@@ -229,21 +229,21 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
}
public void testSelfmadeGPXWithoutGeocodes() throws Exception {
- final List<cgCache> caches = readGPX11(R.raw.no_connector);
+ final List<Geocache> caches = readGPX11(R.raw.no_connector);
assertEquals(13, caches.size());
}
public void testTexasChallenge2012() throws Exception {
- final List<cgCache> caches = readGPX10(R.raw.challenge);
+ final List<Geocache> caches = readGPX10(R.raw.challenge);
// previously these caches overwrote each other during parsing
assertEquals(130, caches.size());
}
public void testGeoToad() throws Exception {
- final List<cgCache> caches = readGPX10(R.raw.geotoad);
+ final List<Geocache> caches = readGPX10(R.raw.geotoad);
assertEquals(2, caches.size());
List<String> codes = new ArrayList<String>();
- for (cgCache cache : caches) {
+ for (Geocache cache : caches) {
codes.add(cache.getGeocode());
}
assertTrue(codes.contains("GC2KN6K"));
@@ -254,11 +254,11 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
// this test should be in CacheTest, but it is easier to create here due to the GPX import abilities
final String geocode = "GC31J2H";
removeCacheCompletely(geocode);
- final List<cgCache> caches = readGPX10(R.raw.lazy);
+ final List<Geocache> caches = readGPX10(R.raw.lazy);
assertEquals(1, caches.size());
cgData.removeAllFromCache();
// load only the minimum cache, it has several members missing
- final cgCache minimalCache = cgData.loadCache(geocode, EnumSet.of(LoadFlag.LOAD_DB_MINIMAL));
+ final Geocache minimalCache = cgData.loadCache(geocode, EnumSet.of(LoadFlag.LOAD_DB_MINIMAL));
// now check that we load lazy members on demand
assertFalse(minimalCache.getAttributes().isEmpty());
@@ -272,7 +272,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
removeCacheCompletely(geocode);
// first import
- List<cgCache> caches = readGPX10(R.raw.lazy);
+ List<Geocache> caches = readGPX10(R.raw.lazy);
assertEquals(1, caches.size());
assertEquals(6, caches.get(0).getLogs().size());
diff --git a/tests/src/cgeo/geocaching/files/LocParserTest.java b/tests/src/cgeo/geocaching/files/LocParserTest.java
index 5170577..c95d860 100644
--- a/tests/src/cgeo/geocaching/files/LocParserTest.java
+++ b/tests/src/cgeo/geocaching/files/LocParserTest.java
@@ -1,6 +1,6 @@
package cgeo.geocaching.files;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.CacheSize;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.test.AbstractResourceInstrumentationTestCase;
@@ -13,9 +13,9 @@ import java.util.Collection;
import java.util.List;
public class LocParserTest extends AbstractResourceInstrumentationTestCase {
- private List<cgCache> readLoc(int resourceId) throws IOException, ParserException {
+ private List<Geocache> readLoc(int resourceId) throws IOException, ParserException {
final LocParser parser = new LocParser(1);
- Collection<cgCache> caches = null;
+ Collection<Geocache> caches = null;
final InputStream instream = getResourceStream(resourceId);
try {
caches = parser.parse(instream, null);
@@ -25,13 +25,13 @@ public class LocParserTest extends AbstractResourceInstrumentationTestCase {
instream.close();
}
- return new ArrayList<cgCache>(caches);
+ return new ArrayList<Geocache>(caches);
}
public void testOCLoc() throws IOException, ParserException {
- final List<cgCache> caches = readLoc(R.raw.oc5952_loc);
+ final List<Geocache> caches = readLoc(R.raw.oc5952_loc);
assertEquals(1, caches.size());
- final cgCache cache = caches.get(0);
+ final Geocache cache = caches.get(0);
assertNotNull(cache);
assertEquals("OC5952", cache.getGeocode());
assertEquals("Die Schatzinsel / treasure island", cache.getName());
@@ -39,9 +39,9 @@ public class LocParserTest extends AbstractResourceInstrumentationTestCase {
}
public void testGCLoc() throws IOException, ParserException {
- final List<cgCache> caches = readLoc(R.raw.gc1bkp3_loc);
+ final List<Geocache> caches = readLoc(R.raw.gc1bkp3_loc);
assertEquals(1, caches.size());
- final cgCache cache = caches.get(0);
+ final Geocache cache = caches.get(0);
assertNotNull(cache);
assertEquals("GC1BKP3", cache.getGeocode());
assertEquals("Die Schatzinsel / treasure island", cache.getName());
diff --git a/tests/src/cgeo/geocaching/filter/DifficultyFilterTest.java b/tests/src/cgeo/geocaching/filter/DifficultyFilterTest.java
index a24cf72..b3ff056 100644
--- a/tests/src/cgeo/geocaching/filter/DifficultyFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/DifficultyFilterTest.java
@@ -1,15 +1,15 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
public class DifficultyFilterTest extends CGeoTestCase {
public static void testTerrainFilter() {
- final cgCache easy = new cgCache();
+ final Geocache easy = new Geocache();
easy.setDifficulty(1.5f);
- final cgCache hard = new cgCache();
+ final Geocache hard = new Geocache();
hard.setDifficulty(5f);
final DifficultyFilter easyFilter = new DifficultyFilter(1);
diff --git a/tests/src/cgeo/geocaching/filter/SizeFilterTest.java b/tests/src/cgeo/geocaching/filter/SizeFilterTest.java
index a641874..2c6552b 100644
--- a/tests/src/cgeo/geocaching/filter/SizeFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/SizeFilterTest.java
@@ -1,15 +1,15 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.CacheSize;
import java.util.ArrayList;
public class SizeFilterTest extends CGeoTestCase {
- private cgCache micro;
- private cgCache regular;
+ private Geocache micro;
+ private Geocache regular;
private SizeFilter microFilter;
@Override
@@ -17,10 +17,10 @@ public class SizeFilterTest extends CGeoTestCase {
super.setUp();
// cache initialization can only be done without errors after application setup
- micro = new cgCache();
+ micro = new Geocache();
micro.setSize(CacheSize.MICRO);
- regular = new cgCache();
+ regular = new Geocache();
regular.setSize(CacheSize.REGULAR);
microFilter = new SizeFilter(CacheSize.MICRO);
@@ -37,7 +37,7 @@ public class SizeFilterTest extends CGeoTestCase {
}
public void testFilter() {
- final ArrayList<cgCache> list = new ArrayList<cgCache>();
+ final ArrayList<Geocache> list = new ArrayList<Geocache>();
list.add(regular);
list.add(micro);
assertEquals(2, list.size());
diff --git a/tests/src/cgeo/geocaching/filter/StateArchivedFilterTest.java b/tests/src/cgeo/geocaching/filter/StateArchivedFilterTest.java
index 9b40140..2d7f2d2 100644
--- a/tests/src/cgeo/geocaching/filter/StateArchivedFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/StateArchivedFilterTest.java
@@ -1,13 +1,13 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.filter.StateFilter.StateArchivedFilter;
public class StateArchivedFilterTest extends CGeoTestCase {
private StateFilter.StateArchivedFilter archivedFilter;
- private cgCache archivedCache;
+ private Geocache archivedCache;
@Override
protected void setUp() throws Exception {
@@ -15,13 +15,13 @@ public class StateArchivedFilterTest extends CGeoTestCase {
// members can only be setup here, after application is initialized
archivedFilter = new StateArchivedFilter();
- archivedCache = new cgCache();
+ archivedCache = new Geocache();
archivedCache.setArchived(true);
}
public void testAccepts() {
assertTrue(archivedFilter.accepts(archivedCache));
- assertFalse(archivedFilter.accepts(new cgCache()));
+ assertFalse(archivedFilter.accepts(new Geocache()));
}
}
diff --git a/tests/src/cgeo/geocaching/filter/StateDisabledFilterTest.java b/tests/src/cgeo/geocaching/filter/StateDisabledFilterTest.java
index e73f771..6d50beb 100644
--- a/tests/src/cgeo/geocaching/filter/StateDisabledFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/StateDisabledFilterTest.java
@@ -1,26 +1,26 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.filter.StateFilter.StateDisabledFilter;
public class StateDisabledFilterTest extends CGeoTestCase {
private StateFilter.StateDisabledFilter disabledFilter;
- private cgCache disabledCache;
+ private Geocache disabledCache;
@Override
protected void setUp() throws Exception {
super.setUp();
disabledFilter = new StateDisabledFilter();
- disabledCache = new cgCache();
+ disabledCache = new Geocache();
disabledCache.setDisabled(true);
}
public void testAccepts() {
assertTrue(disabledFilter.accepts(disabledCache));
- assertFalse(disabledFilter.accepts(new cgCache()));
+ assertFalse(disabledFilter.accepts(new Geocache()));
}
}
diff --git a/tests/src/cgeo/geocaching/filter/StateFoundFilterTest.java b/tests/src/cgeo/geocaching/filter/StateFoundFilterTest.java
index 053363f..c02794c 100644
--- a/tests/src/cgeo/geocaching/filter/StateFoundFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/StateFoundFilterTest.java
@@ -1,26 +1,26 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.filter.StateFilter.StateFoundFilter;
public class StateFoundFilterTest extends CGeoTestCase {
private StateFilter.StateFoundFilter foundFilter;
- private cgCache foundCache;
+ private Geocache foundCache;
@Override
protected void setUp() throws Exception {
super.setUp();
foundFilter = new StateFoundFilter();
- foundCache = new cgCache();
+ foundCache = new Geocache();
foundCache.setFound(true);
}
public void testAccepts() {
assertTrue(foundFilter.accepts(foundCache));
- assertFalse(foundFilter.accepts(new cgCache()));
+ assertFalse(foundFilter.accepts(new Geocache()));
}
}
diff --git a/tests/src/cgeo/geocaching/filter/StateNonPremiumFilterTest.java b/tests/src/cgeo/geocaching/filter/StateNonPremiumFilterTest.java
index 98d9e63..3c36c0d 100644
--- a/tests/src/cgeo/geocaching/filter/StateNonPremiumFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/StateNonPremiumFilterTest.java
@@ -1,26 +1,26 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.filter.StateFilter.StateNonPremiumFilter;
public class StateNonPremiumFilterTest extends CGeoTestCase {
private StateFilter.StateNonPremiumFilter nonPremiumFilter;
- private cgCache premiumCache;
+ private Geocache premiumCache;
@Override
protected void setUp() throws Exception {
super.setUp();
nonPremiumFilter = new StateNonPremiumFilter();
- premiumCache = new cgCache();
+ premiumCache = new Geocache();
premiumCache.setPremiumMembersOnly(true);
}
public void testAccepts() {
assertFalse(nonPremiumFilter.accepts(premiumCache));
- assertTrue(nonPremiumFilter.accepts(new cgCache()));
+ assertTrue(nonPremiumFilter.accepts(new Geocache()));
}
}
diff --git a/tests/src/cgeo/geocaching/filter/StatePremiumFilterTest.java b/tests/src/cgeo/geocaching/filter/StatePremiumFilterTest.java
index 9221da0..744ebb9 100644
--- a/tests/src/cgeo/geocaching/filter/StatePremiumFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/StatePremiumFilterTest.java
@@ -1,26 +1,26 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.filter.StateFilter.StatePremiumFilter;
public class StatePremiumFilterTest extends CGeoTestCase {
private StateFilter.StatePremiumFilter premiumFilter;
- private cgCache premiumCache;
+ private Geocache premiumCache;
@Override
protected void setUp() throws Exception {
super.setUp();
premiumFilter = new StatePremiumFilter();
- premiumCache = new cgCache();
+ premiumCache = new Geocache();
premiumCache.setPremiumMembersOnly(true);
}
public void testAccepts() {
assertTrue(premiumFilter.accepts(premiumCache));
- assertFalse(premiumFilter.accepts(new cgCache()));
+ assertFalse(premiumFilter.accepts(new Geocache()));
}
}
diff --git a/tests/src/cgeo/geocaching/filter/TerrainFilterTest.java b/tests/src/cgeo/geocaching/filter/TerrainFilterTest.java
index 9deea34..d64f4d9 100644
--- a/tests/src/cgeo/geocaching/filter/TerrainFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/TerrainFilterTest.java
@@ -1,15 +1,15 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
public class TerrainFilterTest extends CGeoTestCase {
public static void testTerrainFilter() {
- final cgCache easy = new cgCache();
+ final Geocache easy = new Geocache();
easy.setTerrain(1.5f);
- final cgCache hard = new cgCache();
+ final Geocache hard = new Geocache();
hard.setTerrain(5f);
final AbstractRangeFilter easyFilter = new TerrainFilter(1);
diff --git a/tests/src/cgeo/geocaching/filter/TypeFilterTest.java b/tests/src/cgeo/geocaching/filter/TypeFilterTest.java
index 5b2631c..3a43b33 100644
--- a/tests/src/cgeo/geocaching/filter/TypeFilterTest.java
+++ b/tests/src/cgeo/geocaching/filter/TypeFilterTest.java
@@ -1,7 +1,7 @@
package cgeo.geocaching.filter;
import cgeo.CGeoTestCase;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.CacheType;
import java.util.ArrayList;
@@ -9,18 +9,18 @@ import java.util.ArrayList;
public class TypeFilterTest extends CGeoTestCase {
private TypeFilter traditionalFilter;
- private cgCache traditional;
- private cgCache mystery;
+ private Geocache traditional;
+ private Geocache mystery;
@Override
protected void setUp() throws Exception {
super.setUp();
traditionalFilter = new TypeFilter(CacheType.TRADITIONAL);
- traditional = new cgCache();
+ traditional = new Geocache();
traditional.setType(CacheType.TRADITIONAL);
- mystery = new cgCache();
+ mystery = new Geocache();
mystery.setType(CacheType.MYSTERY);
}
@@ -30,7 +30,7 @@ public class TypeFilterTest extends CGeoTestCase {
}
public void testFilter() {
- final ArrayList<cgCache> list = new ArrayList<cgCache>();
+ final ArrayList<Geocache> list = new ArrayList<Geocache>();
traditionalFilter.filter(list);
assertEquals(0, list.size());
diff --git a/tests/src/cgeo/geocaching/sorting/DistanceComparatorTest.java b/tests/src/cgeo/geocaching/sorting/DistanceComparatorTest.java
index 91896a5..2db3f59 100644
--- a/tests/src/cgeo/geocaching/sorting/DistanceComparatorTest.java
+++ b/tests/src/cgeo/geocaching/sorting/DistanceComparatorTest.java
@@ -1,6 +1,6 @@
package cgeo.geocaching.sorting;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.geopoint.Geopoint;
import android.test.AndroidTestCase;
@@ -12,9 +12,9 @@ import java.util.List;
public class DistanceComparatorTest extends AndroidTestCase {
public static void testCompareCaches() {
- final List<cgCache> caches = new ArrayList<cgCache>();
+ final List<Geocache> caches = new ArrayList<Geocache>();
for (int i = 0; i < 37; i++) {
- cgCache cache = new cgCache();
+ Geocache cache = new Geocache();
if (i % 3 == 0) {
cache.setCoords(new Geopoint(i, i));
}
diff --git a/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java b/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java
index 98c77fd..18db4b7 100644
--- a/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java
+++ b/tests/src/cgeo/geocaching/sorting/NameComparatorTest.java
@@ -1,12 +1,12 @@
package cgeo.geocaching.sorting;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import android.test.AndroidTestCase;
public class NameComparatorTest extends AndroidTestCase {
- private static class NamedCache extends cgCache {
+ private static class NamedCache extends Geocache {
public NamedCache(final String name) {
this.setName(name);
@@ -31,11 +31,11 @@ public class NameComparatorTest extends AndroidTestCase {
assertEquals("abc000123def456", (new NamedCache("abc123def456")).getNameForSorting());
}
- private void assertSorted(final cgCache cache1, final cgCache cache2) {
+ private void assertSorted(final Geocache cache1, final Geocache cache2) {
assertTrue(comp.compare(cache1, cache2) < 0);
}
- private void assertNotSorted(final cgCache cache1, final cgCache cache2) {
+ private void assertNotSorted(final Geocache cache1, final Geocache cache2) {
assertTrue(comp.compare(cache1, cache2) > 0);
}
}
diff --git a/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedMapTest.java b/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedMapTest.java
index 723b7153..11088e2 100644
--- a/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedMapTest.java
+++ b/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedMapTest.java
@@ -1,6 +1,6 @@
package cgeo.geocaching.utils;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import java.util.Map;
@@ -45,11 +45,11 @@ public class LeastRecentlyUsedMapTest extends AbstractLRUTest {
}
public static void testRemoveEldestEntry() {
- final LeastRecentlyUsedMap<String, cgCache> cache = new LeastRecentlyUsedMap.LruCache<String, cgCache>(10);
- final cgCache first = new cgCache();
+ final LeastRecentlyUsedMap<String, Geocache> cache = new LeastRecentlyUsedMap.LruCache<String, Geocache>(10);
+ final Geocache first = new Geocache();
assertNull(cache.put("1", first));
- final cgCache second = new cgCache();
+ final Geocache second = new Geocache();
assertNull(cache.put("2", second));
assertEquals(2, cache.size());
@@ -59,7 +59,7 @@ public class LeastRecentlyUsedMapTest extends AbstractLRUTest {
assertTrue(cache.containsValue(second));
for (int i = 3; i <= 10; i++) {
- assertNull(cache.put(Integer.toString(i), new cgCache()));
+ assertNull(cache.put(Integer.toString(i), new Geocache()));
}
assertEquals(10, cache.size());
@@ -69,8 +69,8 @@ public class LeastRecentlyUsedMapTest extends AbstractLRUTest {
assertTrue(cache.containsValue(second));
assertNotNull(cache.remove("1")); // just replacing the old entry would not work
- assertNull(cache.put("1", new cgCache()));
- assertNull(cache.put("11", new cgCache()));
+ assertNull(cache.put("1", new Geocache()));
+ assertNull(cache.put("11", new Geocache()));
assertEquals(10, cache.size());
diff --git a/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedSetTest.java b/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedSetTest.java
index 4b4e5f7..7e06b83 100644
--- a/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedSetTest.java
+++ b/tests/src/cgeo/geocaching/utils/LeastRecentlyUsedSetTest.java
@@ -1,6 +1,6 @@
package cgeo.geocaching.utils;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import java.util.Set;
@@ -26,12 +26,12 @@ public class LeastRecentlyUsedSetTest extends AbstractLRUTest {
}
public static void testRemoveEldestEntry() {
- final LeastRecentlyUsedSet<cgCache> caches = new LeastRecentlyUsedSet<cgCache>(10);
- final cgCache first = new cgCache();
+ final LeastRecentlyUsedSet<Geocache> caches = new LeastRecentlyUsedSet<Geocache>(10);
+ final Geocache first = new Geocache();
first.setGeocode("1");
assertTrue(caches.add(first));
- final cgCache second = new cgCache();
+ final Geocache second = new Geocache();
second.setGeocode("2");
assertTrue(caches.add(second));
@@ -44,7 +44,7 @@ public class LeastRecentlyUsedSetTest extends AbstractLRUTest {
assertEquals(2, caches.size());
for (int i = 3; i <= 10; i++) {
- final cgCache cache = new cgCache();
+ final Geocache cache = new Geocache();
cache.setGeocode(Integer.toString(i));
assertTrue(caches.add(cache));
}
@@ -53,7 +53,7 @@ public class LeastRecentlyUsedSetTest extends AbstractLRUTest {
assertTrue(caches.contains(first));
assertTrue(caches.contains(second));
- final cgCache c11 = new cgCache();
+ final Geocache c11 = new Geocache();
c11.setGeocode("11");
assertTrue(caches.add(c11));
diff --git a/tests/src/cgeo/test/Compare.java b/tests/src/cgeo/test/Compare.java
index 71c0976..ca3313e 100644
--- a/tests/src/cgeo/test/Compare.java
+++ b/tests/src/cgeo/test/Compare.java
@@ -4,12 +4,12 @@ import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import cgeo.geocaching.ICache;
-import cgeo.geocaching.cgCache;
+import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.LogType;
public abstract class Compare {
- public static void assertCompareCaches(ICache expected, cgCache actual, boolean all) {
+ public static void assertCompareCaches(ICache expected, Geocache actual, boolean all) {
assertEquals(expected.getGeocode(), actual.getGeocode());
assertTrue(expected.getType() == actual.getType());
assertEquals(expected.getOwnerDisplayName(), actual.getOwnerDisplayName());