From e45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sun, 7 Apr 2013 11:10:52 +0200 Subject: fix tests after OC changes --- tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java') 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() { -- cgit v1.1