From eb049cd9ebff77da7cb59a338cdfc836e9e908fb Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 16 Dec 2014 21:17:07 +0100 Subject: Fix tests (GC3XX5J is disabled) Also, limit GC3XX5J modifications to the mocked cache instead of the test itself. --- tests/src/cgeo/geocaching/CgeoApplicationTest.java | 12 +++--------- tests/src/cgeo/geocaching/test/mock/GC3XX5J.java | 12 ++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'tests/src') diff --git a/tests/src/cgeo/geocaching/CgeoApplicationTest.java b/tests/src/cgeo/geocaching/CgeoApplicationTest.java index 8645907..c00f549 100644 --- a/tests/src/cgeo/geocaching/CgeoApplicationTest.java +++ b/tests/src/cgeo/geocaching/CgeoApplicationTest.java @@ -396,17 +396,11 @@ public class CgeoApplicationTest extends CGeoTestCase { */ public static void testSearchByGeocodeBasis() { for (MockedCache mockedCache : RegExPerformanceTest.MOCKED_CACHES) { - String oldUser = mockedCache.getMockedDataUser(); + final String oldUser = mockedCache.getMockedDataUser(); try { mockedCache.setMockedDataUser(Settings.getUsername()); - Geocache parsedCache = CgeoApplicationTest.testSearchByGeocode(mockedCache.getGeocode()); - if (null != parsedCache) { - // fake found flag for one cache until it will be updated - if (parsedCache.getGeocode().equals("GC3XX5J") && Settings.getUsername().equals("mucek4")) { - parsedCache.setFound(false); - } - Compare.assertCompareCaches(mockedCache, parsedCache, true); - } + final Geocache parsedCache = CgeoApplicationTest.testSearchByGeocode(mockedCache.getGeocode()); + Compare.assertCompareCaches(mockedCache, parsedCache, true); } finally { mockedCache.setMockedDataUser(oldUser); } diff --git a/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java b/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java index d468b3b..03959b9 100644 --- a/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java +++ b/tests/src/cgeo/geocaching/test/mock/GC3XX5J.java @@ -5,6 +5,7 @@ import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.location.Geopoint; +import cgeo.geocaching.settings.Settings; import org.eclipse.jdt.annotation.NonNull; @@ -136,4 +137,15 @@ public class GC3XX5J extends MockedCache { public String getShortDescription() { return "Kadar zbolimo nam pomaga...

When we get sick, they are helpful..."; } + + @Override + public boolean isFound() { + return Settings.getUsername().equals("mucek4"); + } + + @Override + public boolean isDisabled() { + // The cache has been disabled since 2014-12-13. + return true; + } } -- cgit v1.1