aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java6
-rw-r--r--main/src/cgeo/geocaching/ICache.java2
-rw-r--r--main/src/cgeo/geocaching/SearchResult.java2
-rw-r--r--main/src/cgeo/geocaching/cgCache.java19
-rw-r--r--main/src/cgeo/geocaching/cgData.java10
-rw-r--r--main/src/cgeo/geocaching/connector/GeocachingAustraliaConnector.java6
-rw-r--r--main/src/cgeo/geocaching/connector/GeopeitusConnector.java6
-rw-r--r--main/src/cgeo/geocaching/connector/IConnector.java10
-rw-r--r--main/src/cgeo/geocaching/connector/UnknownConnector.java6
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCConnector.java8
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCMap.java2
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCParser.java5
-rw-r--r--main/src/cgeo/geocaching/connector/gc/IconDecoder.java3
-rw-r--r--main/src/cgeo/geocaching/connector/oc/OCConnector.java6
-rw-r--r--main/src/cgeo/geocaching/connector/ox/OXConnector.java6
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java6
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java30
-rw-r--r--tests/src/cgeo/geocaching/files/GPXParserTest.java2
-rw-r--r--tests/src/cgeo/geocaching/test/mock/GC2CJPF.java4
-rw-r--r--tests/src/cgeo/geocaching/test/mock/MockedCache.java2
-rw-r--r--tests/src/cgeo/test/Compare.java2
21 files changed, 89 insertions, 54 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index 933e2d2..373536b 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -1543,7 +1543,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
Button buttonRemove = (Button) view.findViewById(R.id.remove_from_watchlist);
TextView text = (TextView) view.findViewById(R.id.watchlist_text);
- if (cache.isOnWatchlist() || cache.isOwn()) {
+ if (cache.isOnWatchlist() || cache.isOwner()) {
buttonAdd.setVisibility(View.GONE);
buttonRemove.setVisibility(View.VISIBLE);
text.setText(R.string.cache_watchlist_on);
@@ -1554,7 +1554,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
}
// the owner of a cache has it always on his watchlist. Adding causes an error
- if (cache.isOwn()) {
+ if (cache.isOwner()) {
buttonAdd.setEnabled(false);
buttonAdd.setVisibility(View.GONE);
buttonRemove.setEnabled(false);
@@ -1570,7 +1570,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
LinearLayout layout = (LinearLayout) view.findViewById(R.id.favpoint_box);
boolean supportsFavoritePoints = cache.supportsFavoritePoints();
layout.setVisibility(supportsFavoritePoints ? View.VISIBLE : View.GONE);
- if (!supportsFavoritePoints || cache.isOwn() || !Settings.isPremiumMember()) {
+ if (!supportsFavoritePoints || cache.isOwner() || !Settings.isPremiumMember()) {
return;
}
Button buttonAdd = (Button) view.findViewById(R.id.add_to_favpoint);
diff --git a/main/src/cgeo/geocaching/ICache.java b/main/src/cgeo/geocaching/ICache.java
index 030c53f..9aa01bb 100644
--- a/main/src/cgeo/geocaching/ICache.java
+++ b/main/src/cgeo/geocaching/ICache.java
@@ -28,7 +28,7 @@ public interface ICache extends IBasicCache {
/**
* @return true if the user is the owner of the cache, false else
*/
- public boolean isOwn();
+ public boolean isOwner();
/**
* @return true is the cache is archived, false else
diff --git a/main/src/cgeo/geocaching/SearchResult.java b/main/src/cgeo/geocaching/SearchResult.java
index d1b1df6..48e6233 100644
--- a/main/src/cgeo/geocaching/SearchResult.java
+++ b/main/src/cgeo/geocaching/SearchResult.java
@@ -195,7 +195,7 @@ public class SearchResult implements Parcelable {
for (cgCache cache : caches) {
// Is there any reason to exclude the cache from the list?
final boolean excludeCache = (excludeDisabled && cache.isDisabled()) ||
- (excludeMine && (cache.isOwn() || cache.isFound())) ||
+ (excludeMine && (cache.isOwner() || cache.isFound())) ||
(cacheType != CacheType.ALL && cacheType != cache.getType());
if (!excludeCache) {
result.addCache(cache);
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index 24bd66b..b120581 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -47,6 +47,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
@@ -88,7 +89,6 @@ public class cgCache implements ICache, IWaypoint {
private boolean premiumMembersOnly = false;
private boolean found = false;
private boolean favorite = false;
- private boolean own = false;
private int favoritePoints = 0;
private float rating = 0; // valid ratings are larger than zero
private int votes = 0;
@@ -187,7 +187,6 @@ public class cgCache implements ICache, IWaypoint {
reliableLatLon = other.reliableLatLon;
archived = other.archived;
found = other.found;
- own = other.own;
disabled = other.disabled;
favorite = other.favorite;
onWatchlist = other.onWatchlist;
@@ -352,7 +351,6 @@ public class cgCache implements ICache, IWaypoint {
cacheType == other.cacheType &&
size == other.size &&
found == other.found &&
- own == other.own &&
premiumMembersOnly == other.premiumMembersOnly &&
difficulty == other.difficulty &&
terrain == other.terrain &&
@@ -472,14 +470,13 @@ public class cgCache implements ICache, IWaypoint {
}
public List<LogType> getPossibleLogTypes() {
- boolean isOwner = getOwnerUserId() != null && getOwnerUserId().equalsIgnoreCase(Settings.getUsername());
- List<LogType> logTypes = new ArrayList<LogType>();
+ final List<LogType> logTypes = new LinkedList<LogType>();
if (isEventCache()) {
logTypes.add(LogType.WILL_ATTEND);
logTypes.add(LogType.NOTE);
logTypes.add(LogType.ATTENDED);
logTypes.add(LogType.NEEDS_ARCHIVE);
- if (isOwner) {
+ if (isOwner()) {
logTypes.add(LogType.ANNOUNCEMENT);
}
} else if (CacheType.WEBCAM == cacheType) {
@@ -495,7 +492,7 @@ public class cgCache implements ICache, IWaypoint {
logTypes.add(LogType.NEEDS_ARCHIVE);
logTypes.add(LogType.NEEDS_MAINTENANCE);
}
- if (isOwner) {
+ if (isOwner()) {
logTypes.add(LogType.OWNER_MAINTENANCE);
logTypes.add(LogType.TEMP_DISABLE_LISTING);
logTypes.add(LogType.ENABLE_LISTING);
@@ -593,8 +590,8 @@ public class cgCache implements ICache, IWaypoint {
}
@Override
- public boolean isOwn() {
- return own;
+ public boolean isOwner() {
+ return getConnector().isOwner(this);
}
@Override
@@ -1076,10 +1073,6 @@ public class cgCache implements ICache, IWaypoint {
this.found = found;
}
- public void setOwn(boolean own) {
- this.own = own;
- }
-
public void setAttributes(List<String> attributes) {
this.attributes.set(attributes);
}
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java
index 8033993..01657f9 100644
--- a/main/src/cgeo/geocaching/cgData.java
+++ b/main/src/cgeo/geocaching/cgData.java
@@ -59,7 +59,7 @@ public class cgData {
/** The list of fields needed for mapping. */
private static final String[] CACHE_COLUMNS = new String[] {
- "_id", "updated", "reason", "detailed", "detailedupdate", "visiteddate", "geocode", "cacheid", "guid", "type", "name", "own", "owner", "owner_real", "hidden", "hint", "size",
+ "_id", "updated", "reason", "detailed", "detailedupdate", "visiteddate", "geocode", "cacheid", "guid", "type", "name", "owner", "owner_real", "hidden", "hint", "size",
"difficulty", "distance", "direction", "terrain", "latlon", "location", "latitude", "longitude", "elevation", "shortdesc",
"favourite_cnt", "rating", "votes", "myvote", "disabled", "archived", "members", "found", "favourite", "inventorycoins", "inventorytags",
"inventoryunknown", "onWatchlist", "personal_note", "reliable_latlon", "coordsChanged", "finalDefined"
@@ -104,7 +104,7 @@ public class cgData {
+ "guid text, "
+ "type text, "
+ "name text, "
- + "own integer not null default 0, "
+ + "own integer not null default 0, " // TODO: remove this column during the next database upgrade
+ "owner text, "
+ "owner_real text, "
+ "hidden long, "
@@ -984,7 +984,6 @@ public class cgData {
values.put("guid", cache.getGuid());
values.put("type", cache.getType().id);
values.put("name", cache.getName());
- values.put("own", cache.isOwn() ? 1 : 0);
values.put("owner", cache.getOwnerDisplayName());
values.put("owner_real", cache.getOwnerUserId());
if (cache.getHiddenDate() == null) {
@@ -1559,7 +1558,7 @@ public class cgData {
local_cci[7] = cursor.getColumnIndex("guid");
local_cci[8] = cursor.getColumnIndex("type");
local_cci[9] = cursor.getColumnIndex("name");
- local_cci[10] = cursor.getColumnIndex("own");
+ // TODO: entry number 10 has been removed, all should be renumbered
local_cci[11] = cursor.getColumnIndex("owner");
local_cci[12] = cursor.getColumnIndex("owner_real");
local_cci[13] = cursor.getColumnIndex("hidden");
@@ -1603,7 +1602,6 @@ public class cgData {
cache.setGuid(cursor.getString(cacheColumnIndex[7]));
cache.setType(CacheType.getById(cursor.getString(cacheColumnIndex[8])));
cache.setName(cursor.getString(cacheColumnIndex[9]));
- cache.setOwn(cursor.getInt(cacheColumnIndex[10]) == 1);
cache.setOwnerDisplayName(cursor.getString(cacheColumnIndex[11]));
cache.setOwnerUserId(cursor.getString(cacheColumnIndex[12]));
long dateValue = cursor.getLong(cacheColumnIndex[13]);
@@ -2735,7 +2733,7 @@ public class cgData {
public static Set<Waypoint> loadWaypoints(final Viewport viewport, boolean excludeMine, boolean excludeDisabled, CacheType type) {
final StringBuilder where = new StringBuilder(buildCoordinateWhere(dbTableWaypoints, viewport));
if (excludeMine) {
- where.append(" and ").append(dbTableCaches).append(".own == 0 and ").append(dbTableCaches).append(".found == 0");
+ where.append(" and ").append(dbTableCaches).append(".found == 0");
}
if (excludeDisabled) {
where.append(" and ").append(dbTableCaches).append(".disabled == 0");
diff --git a/main/src/cgeo/geocaching/connector/GeocachingAustraliaConnector.java b/main/src/cgeo/geocaching/connector/GeocachingAustraliaConnector.java
index 30d1a4b..15113da 100644
--- a/main/src/cgeo/geocaching/connector/GeocachingAustraliaConnector.java
+++ b/main/src/cgeo/geocaching/connector/GeocachingAustraliaConnector.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.cgCache;
import org.apache.commons.lang3.StringUtils;
@@ -22,6 +23,11 @@ public class GeocachingAustraliaConnector extends AbstractConnector {
}
@Override
+ public boolean isOwner(final ICache cache) {
+ return false;
+ }
+
+ @Override
public boolean canHandle(final String geocode) {
return (StringUtils.startsWithIgnoreCase(geocode, "GA") || StringUtils.startsWithIgnoreCase(geocode, "TP")) && isNumericId(geocode.substring(2));
}
diff --git a/main/src/cgeo/geocaching/connector/GeopeitusConnector.java b/main/src/cgeo/geocaching/connector/GeopeitusConnector.java
index 6ef91db..c20b8f8 100644
--- a/main/src/cgeo/geocaching/connector/GeopeitusConnector.java
+++ b/main/src/cgeo/geocaching/connector/GeopeitusConnector.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.cgCache;
import org.apache.commons.lang3.StringUtils;
@@ -22,6 +23,11 @@ public class GeopeitusConnector extends AbstractConnector {
}
@Override
+ public boolean isOwner(final ICache cache) {
+ return false;
+ }
+
+ @Override
public boolean canHandle(String geocode) {
return StringUtils.startsWith(geocode, "GE") && isNumericId(geocode.substring(2));
}
diff --git a/main/src/cgeo/geocaching/connector/IConnector.java b/main/src/cgeo/geocaching/connector/IConnector.java
index 2944bed..d45368a 100644
--- a/main/src/cgeo/geocaching/connector/IConnector.java
+++ b/main/src/cgeo/geocaching/connector/IConnector.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.enumerations.CacheRealm;
import cgeo.geocaching.geopoint.Geopoint;
@@ -140,5 +141,14 @@ public interface IConnector {
*
* @return
*/
+
public boolean isActivated();
+
+ /**
+ * Check if the current user is the owner of the given cache.
+ *
+ * @param cache a cache that this connector must be able to handle
+ * @return <code>true</code> if the current user is the cache owner, <code>false</code> otherwise
+ */
+ public boolean isOwner(final ICache cache);
}
diff --git a/main/src/cgeo/geocaching/connector/UnknownConnector.java b/main/src/cgeo/geocaching/connector/UnknownConnector.java
index 991d31c..3edd8a6 100644
--- a/main/src/cgeo/geocaching/connector/UnknownConnector.java
+++ b/main/src/cgeo/geocaching/connector/UnknownConnector.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.cgCache;
import org.apache.commons.lang3.StringUtils;
@@ -22,6 +23,11 @@ public class UnknownConnector extends AbstractConnector {
}
@Override
+ public boolean isOwner(final ICache cache) {
+ return false;
+ }
+
+ @Override
public boolean canHandle(final String geocode) {
return StringUtils.isNotBlank(geocode);
}
diff --git a/main/src/cgeo/geocaching/connector/gc/GCConnector.java b/main/src/cgeo/geocaching/connector/gc/GCConnector.java
index 8943835..7716b8f 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCConnector.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCConnector.java
@@ -1,7 +1,9 @@
package cgeo.geocaching.connector.gc;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
+import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgData;
import cgeo.geocaching.connector.AbstractConnector;
@@ -135,6 +137,12 @@ public class GCConnector extends AbstractConnector implements ISearchByGeocode,
return cacheHasReliableLatLon;
}
+ @Override
+ public boolean isOwner(final ICache cache) {
+ return StringUtils.equalsIgnoreCase(cache.getOwnerUserId(), Settings.getUsername());
+
+ }
+
public static boolean addToWatchlist(cgCache cache) {
final boolean added = GCParser.addToWatchlist(cache);
if (added) {
diff --git a/main/src/cgeo/geocaching/connector/gc/GCMap.java b/main/src/cgeo/geocaching/connector/gc/GCMap.java
index 9a8123d..3b8dc1e 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCMap.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCMap.java
@@ -220,7 +220,7 @@ public class GCMap {
}
boolean exclude = false;
- if (Settings.isExcludeMyCaches() && (cache.isFound() || cache.isOwn())) { // workaround for BM
+ if (Settings.isExcludeMyCaches() && (cache.isFound() || cache.isOwner())) { // workaround for BM
exclude = true;
}
if (Settings.isExcludeDisabledCaches() && cache.isDisabled()) {
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java
index 274ba0d..d9d9c0b 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCParser.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java
@@ -200,9 +200,6 @@ public abstract class GCParser {
// found it
cache.setFound(row.contains("/images/icons/16/found.png"));
- // own it
- cache.setOwn(row.contains("/images/icons/16/placed.png"));
-
// id
String result = BaseUtils.getMatch(row, GCConstants.PATTERN_SEARCH_ID, null);
if (null != result) {
@@ -372,8 +369,6 @@ public abstract class GCParser {
// owner real name
cache.setOwnerUserId(Network.decode(BaseUtils.getMatch(page, GCConstants.PATTERN_OWNER_USERID, true, cache.getOwnerUserId())));
- cache.setOwn(StringUtils.equalsIgnoreCase(cache.getOwnerUserId(), Settings.getUsername()));
-
cache.setUserModifiedCoords(false);
String tableInside = page;
diff --git a/main/src/cgeo/geocaching/connector/gc/IconDecoder.java b/main/src/cgeo/geocaching/connector/gc/IconDecoder.java
index 9c28048..0bebd02 100644
--- a/main/src/cgeo/geocaching/connector/gc/IconDecoder.java
+++ b/main/src/cgeo/geocaching/connector/gc/IconDecoder.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector.gc;
+import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.enumerations.CacheType;
@@ -105,7 +106,7 @@ public abstract class IconDecoder {
cache.setFound(true);
return true;
case CT_OWN:
- cache.setOwn(true);
+ cache.setOwnerUserId(Settings.getUsername());
return true;
case CT_MEGAEVENT:
cache.setType(CacheType.MEGA_EVENT);
diff --git a/main/src/cgeo/geocaching/connector/oc/OCConnector.java b/main/src/cgeo/geocaching/connector/oc/OCConnector.java
index 24fd7d6..e290e51 100644
--- a/main/src/cgeo/geocaching/connector/oc/OCConnector.java
+++ b/main/src/cgeo/geocaching/connector/oc/OCConnector.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector.oc;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.connector.AbstractConnector;
import cgeo.geocaching.enumerations.CacheRealm;
@@ -48,6 +49,11 @@ public class OCConnector extends AbstractConnector {
}
@Override
+ public boolean isOwner(final ICache cache) {
+ return false;
+ }
+
+ @Override
protected String getCacheUrlPrefix() {
return "http://" + host + "/viewcache.php?wp=";
}
diff --git a/main/src/cgeo/geocaching/connector/ox/OXConnector.java b/main/src/cgeo/geocaching/connector/ox/OXConnector.java
index 98b1656..17d8ab4 100644
--- a/main/src/cgeo/geocaching/connector/ox/OXConnector.java
+++ b/main/src/cgeo/geocaching/connector/ox/OXConnector.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.connector.ox;
+import cgeo.geocaching.ICache;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
@@ -47,6 +48,11 @@ public class OXConnector extends AbstractConnector implements ISearchByCenter, I
}
@Override
+ public boolean isOwner(final ICache cache) {
+ return false;
+ }
+
+ @Override
public SearchResult searchByGeocode(String geocode, String guid, CancellableHandler handler) {
final cgCache cache = OpenCachingApi.searchByGeoCode(geocode);
if (cache == null) {
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index af45b6f6..80d3c89 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -1145,7 +1145,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
final List<cgCache> tempList = caches.getAsList();
for (cgCache cache : tempList) {
- if ((cache.isFound() && excludeMine) || (cache.isOwn() && excludeMine) || (cache.isDisabled() && excludeDisabled)) {
+ if ((cache.isFound() && excludeMine) || (cache.isOwner() && excludeMine) || (cache.isDisabled() && excludeDisabled)) {
caches.remove(cache);
}
}
@@ -1634,7 +1634,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
.append(cache.getType().id)
.append(cache.isDisabled() || cache.isArchived())
.append(cache.getCacheRealm().id)
- .append(cache.isOwn())
+ .append(cache.isOwner())
.append(cache.isFound())
.append(cache.hasUserModifiedCoords())
.append(cache.getPersonalNote())
@@ -1665,7 +1665,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
layers.add(getResources().getDrawable(cache.getType().markerId));
insets.add(INSET_TYPE[resolution]);
// own
- if (cache.isOwn()) {
+ if (cache.isOwner()) {
layers.add(getResources().getDrawable(R.drawable.marker_own));
insets.add(INSET_OWN[resolution]);
// if not, checked if stored
diff --git a/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java b/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java
index af5d1bc..33f936e 100644
--- a/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/IconDecoderTest.java
@@ -106,25 +106,25 @@ public class IconDecoderTest extends AbstractResourceInstrumentationTestCase {
assertTrue(parseMapPNG(bitmap, 132, 136, 12).isFound()); // GC3JDBW
assertTrue(parseMapPNG(bitmap, 68, 24, 12).isFound()); // GC2T0AH
- assertTrue(parseMapPNG(bitmap, 176, 232, 12).isOwn()); // GC2RPBX
+ assertTrue(parseMapPNG(bitmap, 176, 232, 12).isOwner()); // GC2RPBX
assertTrue(parseMapPNG(bitmap, 148, 60, 12).isFound()); // GC31FY6
assertTrue(parseMapPNG(bitmap, 216, 20, 12).isFound()); // GC2KP3M
- assertTrue(parseMapPNG(bitmap, 212, 184, 12).isOwn()); // GC30W3K
- assertTrue(parseMapPNG(bitmap, 148, 72, 12).isOwn()); // GC2RPAZ
- assertTrue(parseMapPNG(bitmap, 216, 48, 12).isOwn()); // GC2RP8W
+ assertTrue(parseMapPNG(bitmap, 212, 184, 12).isOwner()); // GC30W3K
+ assertTrue(parseMapPNG(bitmap, 148, 72, 12).isOwner()); // GC2RPAZ
+ assertTrue(parseMapPNG(bitmap, 216, 48, 12).isOwner()); // GC2RP8W
assertTrue(parseMapPNG(bitmap, 212, 60, 12).isFound()); // GC3CC97
- assertTrue(parseMapPNG(bitmap, 148, 100, 12).isOwn()); // GC2RPAT
+ assertTrue(parseMapPNG(bitmap, 148, 100, 12).isOwner()); // GC2RPAT
assertTrue(parseMapPNG(bitmap, 104, 136, 12).isFound()); // GC3AE31
- assertTrue(parseMapPNG(bitmap, 52, 96, 12).isOwn()); // GC2RPCH
- assertTrue(parseMapPNG(bitmap, 172, 156, 12).isOwn()); // GC2RQ07
+ assertTrue(parseMapPNG(bitmap, 52, 96, 12).isOwner()); // GC2RPCH
+ assertTrue(parseMapPNG(bitmap, 172, 156, 12).isOwner()); // GC2RQ07
assertTrue(parseMapPNG(bitmap, 116, 56, 12).isFound()); // GC3AYR2
- assertTrue(parseMapPNG(bitmap, 208, 68, 12).isOwn()); // GC2RP93
- assertTrue(parseMapPNG(bitmap, 200, 52, 12).isOwn()); // GC2RPAA
+ assertTrue(parseMapPNG(bitmap, 208, 68, 12).isOwner()); // GC2RP93
+ assertTrue(parseMapPNG(bitmap, 200, 52, 12).isOwner()); // GC2RPAA
assertTrue(parseMapPNG(bitmap, 208, 44, 12).isFound()); // GC3HE15
- assertTrue(parseMapPNG(bitmap, 112, 76, 12).isOwn()); // GC2RPBE
- assertTrue(parseMapPNG(bitmap, 232, 192, 12).isOwn()); // GC2E1KF
+ assertTrue(parseMapPNG(bitmap, 112, 76, 12).isOwner()); // GC2RPBE
+ assertTrue(parseMapPNG(bitmap, 232, 192, 12).isOwner()); // GC2E1KF
assertTrue(parseMapPNG(bitmap, 184, 76, 12).isFound()); // GC2NK5R
- assertTrue(parseMapPNG(bitmap, 132, 148, 12).isOwn()); // GC2RPBC
+ assertTrue(parseMapPNG(bitmap, 132, 148, 12).isOwner()); // GC2RPBC
}
public void testParseExtraMap3() {
@@ -389,9 +389,9 @@ public class IconDecoderTest extends AbstractResourceInstrumentationTestCase {
assertTrue(parseMapPNG(bitmap, 72, 16, 14).isFound());
assertTrue(parseMapPNG(bitmap, 100, 16, 14).isFound());
assertTrue(parseMapPNG(bitmap, 128, 16, 14).isFound());
- assertTrue(parseMapPNG(bitmap, 44, 44, 14).isOwn());
- assertTrue(parseMapPNG(bitmap, 76, 44, 14).isOwn());
- assertTrue(parseMapPNG(bitmap, 132, 44, 14).isOwn());
+ assertTrue(parseMapPNG(bitmap, 44, 44, 14).isOwner());
+ assertTrue(parseMapPNG(bitmap, 76, 44, 14).isOwner());
+ assertTrue(parseMapPNG(bitmap, 132, 44, 14).isOwner());
assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 40, 72, 14).getType());
assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 72, 72, 14).getType());
assertEquals(CacheType.MULTI, parseMapPNG(bitmap, 100, 72, 14).getType());
diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java
index db29813..ecca308 100644
--- a/tests/src/cgeo/geocaching/files/GPXParserTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java
@@ -141,7 +141,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase {
assertFalse(cache.isDisabled());
assertFalse(cache.isEventCache());
assertFalse(cache.isPremiumMembersOnly());
- assertFalse(cache.isOwn());
+ assertFalse(cache.isOwner());
assertTrue(cache.isFound());
assertEquals("Station3: Der zerbrochene Stein zählt doppelt.\nFinal: Oben neben dem Tor", cache.getHint());
// logs
diff --git a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
index cc19eb3..d6601d5 100644
--- a/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
+++ b/tests/src/cgeo/geocaching/test/mock/GC2CJPF.java
@@ -103,11 +103,11 @@ public class GC2CJPF extends MockedCache {
* @see cgeo.geocaching.test.mock.MockedCache#isOwn()
*/
@Override
- public boolean isOwn() {
+ public boolean isOwner() {
if ("Tom03".equals(Settings.getUsername())) {
return true;
}
- return super.isOwn();
+ return super.isOwner();
}
@Override
diff --git a/tests/src/cgeo/geocaching/test/mock/MockedCache.java b/tests/src/cgeo/geocaching/test/mock/MockedCache.java
index f667264..7ad566a 100644
--- a/tests/src/cgeo/geocaching/test/mock/MockedCache.java
+++ b/tests/src/cgeo/geocaching/test/mock/MockedCache.java
@@ -94,7 +94,7 @@ public abstract class MockedCache implements ICache {
}
@Override
- public boolean isOwn() {
+ public boolean isOwner() {
return false;
}
diff --git a/tests/src/cgeo/test/Compare.java b/tests/src/cgeo/test/Compare.java
index 4d0e08e..71c0976 100644
--- a/tests/src/cgeo/test/Compare.java
+++ b/tests/src/cgeo/test/Compare.java
@@ -27,7 +27,7 @@ public abstract class Compare {
if (all) {
assertEquals(expected.getCoords(), actual.getCoords());
assertTrue(actual.isReliableLatLon());
- assertEquals(expected.isOwn(), actual.isOwn());
+ assertEquals(expected.isOwner(), actual.isOwner());
assertEquals(expected.getOwnerUserId(), actual.getOwnerUserId());
assertEquals(expected.getHint(), actual.getHint());
assertTrue(actual.getDescription().startsWith(expected.getDescription()));