diff options
Diffstat (limited to 'tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java')
-rw-r--r-- | tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java b/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java index 52e5649..a5631e1 100644 --- a/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java +++ b/tests/src/cgeo/geocaching/connector/opencaching/OCXMLTest.java @@ -6,6 +6,8 @@ import cgeo.geocaching.Settings; import cgeo.geocaching.connector.oc.OCXMLClient; import cgeo.geocaching.enumerations.CacheType; +import java.util.Collection; + public class OCXMLTest extends CGeoTestCase { public static void testOCGetCache() { @@ -57,4 +59,25 @@ public class OCXMLTest extends CGeoTestCase { assertFalse(cache.getDescription().length() < 100); } + + public static void testNoArchivedInNearby() { + + boolean oldExcludeDisabled = Settings.isExcludeDisabledCaches(); + boolean oldExcludeMine = Settings.isExcludeMyCaches(); + try { + Settings.setExcludeDisabledCaches(false); + Settings.setExcludeMine(false); + // get an archived cache + Geocache cache = OCXMLClient.getCache("OCD541"); + assertNotNull(cache); + assertTrue(cache.isArchived()); + // Get nearby for this cache + Collection<Geocache> caches = OCXMLClient.getCachesAround(cache.getCoords(), 0.5); + // Should not be in the result! + assertFalse(caches.contains(cache)); + } finally { + Settings.setExcludeDisabledCaches(oldExcludeDisabled); + Settings.setExcludeMine(oldExcludeMine); + } + } } |