diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2013-04-07 11:10:52 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2013-04-07 11:11:35 +0200 |
commit | e45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a (patch) | |
tree | aa9b4b064bcca5c02123c3a6d2ce29c1dcc165f0 /tests | |
parent | ef8d23593daed17486f19b1d5f16b2e7798c580f (diff) | |
download | cgeo-e45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a.zip cgeo-e45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a.tar.gz cgeo-e45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a.tar.bz2 |
fix tests after OC changes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java b/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java index b12823a..2e4855f 100644 --- a/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java +++ b/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java @@ -5,6 +5,10 @@ import cgeo.geocaching.Geocache; import cgeo.geocaching.Settings; import cgeo.geocaching.enumerations.CacheType; +import org.apache.commons.lang3.StringUtils; + +import android.text.Html; + import java.util.Collection; public class OCXMLTest extends CGeoTestCase { @@ -89,25 +93,21 @@ public class OCXMLTest extends CGeoTestCase { assertNotNull(cache); try { assertEquals(geoCode, cache.getGeocode()); - assertEquals(description, cache.getDescription()); + // ignore copyright as the date part will change all the time + assertEquals(description, removeCopyrightAndTags(cache.getDescription())); cache.store(null); // reload, make sure description is not duplicated cache = OCXMLClient.getCache(geoCode); assertNotNull(cache); - assertEquals(description, cache.getDescription()); + assertEquals(description, removeCopyrightAndTags(cache.getDescription())); } finally { deleteCacheFromDB(geoCode); } } - public static void testRemoveMarkupCache() { - final String geoCode = "OCEFBA"; - final String description = "Bei dem Cache kannst du einen kleinen Schatz bergen. Bitte lege aber einen ander Schatz in das Döschen. Achtung vor Automuggels."; - - Geocache cache = OCXMLClient.getCache(geoCode); - assertNotNull(cache); - assertEquals(description, cache.getDescription()); + private static String removeCopyrightAndTags(String input) { + return Html.fromHtml(StringUtils.substringBefore(input, "©")).toString().trim(); } public static void testRemoveMarkup() { |