From 530440bbb9ce55f96395055abe86dcdcac3ca2a6 Mon Sep 17 00:00:00 2001 From: Michael Keppler Date: Fri, 25 Apr 2014 14:23:03 +0200 Subject: fix #3791: have logs separated from caches --- tests/src/cgeo/geocaching/export/ExportTest.java | 3 ++- tests/src/cgeo/geocaching/files/GPXParserTest.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/src/cgeo/geocaching/export/ExportTest.java b/tests/src/cgeo/geocaching/export/ExportTest.java index aeab90e..a9fceec 100644 --- a/tests/src/cgeo/geocaching/export/ExportTest.java +++ b/tests/src/cgeo/geocaching/export/ExportTest.java @@ -13,6 +13,7 @@ import cgeo.geocaching.utils.FileUtils; import java.io.File; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; @@ -32,8 +33,8 @@ public class ExportTest extends CGeoTestCase { cache.setGeocode("GCX1234"); cache.setCoords(new Geopoint("N 49 44.000 E 8 37.000")); final LogEntry log = new LogEntry(1353244820000L, LogType.FOUND_IT, "Smile: \ud83d\ude0a"); - cache.getLogs().add(log); DataStore.saveCache(cache, LoadFlags.SAVE_ALL); + DataStore.saveLogsWithoutTransaction(cache.getGeocode(), Collections.singletonList(log)); ArrayList exportList = new ArrayList(); exportList.add(cache); GpxExportTester gpxExport = new GpxExportTester(); diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index 4cd0b6f..e1f3417 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -265,8 +265,8 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { final Geocache minimalCache = DataStore.loadCache(geocode, EnumSet.of(LoadFlag.LOAD_DB_MINIMAL)); // now check that we load lazy members on demand - assertThat(minimalCache.getAttributes().isEmpty()).isFalse(); - assertThat(minimalCache.getLogs().isEmpty()).isFalse(); + assertThat(minimalCache.getAttributes()).isNotEmpty(); + assertThat(minimalCache.getLogs()).isNotEmpty(); removeCacheCompletely(geocode); } -- cgit v1.1