aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector
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/src/cgeo/geocaching/connector
parent56106aba18200cd87bc4a51858bdf1125fe913af (diff)
downloadcgeo-b53b6303ae321276d8c25d6a492372ac615580a2.zip
cgeo-b53b6303ae321276d8c25d6a492372ac615580a2.tar.gz
cgeo-b53b6303ae321276d8c25d6a492372ac615580a2.tar.bz2
Refactoring: rename cgCache into Geocache
Diffstat (limited to 'tests/src/cgeo/geocaching/connector')
-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
5 files changed, 23 insertions, 23 deletions
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());