aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/cgDataTest.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-04-23 07:50:26 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-04-23 07:50:26 +0200
commitd2fba594dfea96b17ab01bb12afbc37ec10fe251 (patch)
tree2e272eae1a0eeadc9213e8059f8f1d6dc381e048 /tests/src/cgeo/geocaching/cgDataTest.java
parent0d19a993a9d2e99bd4f0627d182870ee1606cb91 (diff)
downloadcgeo-d2fba594dfea96b17ab01bb12afbc37ec10fe251.zip
cgeo-d2fba594dfea96b17ab01bb12afbc37ec10fe251.tar.gz
cgeo-d2fba594dfea96b17ab01bb12afbc37ec10fe251.tar.bz2
refactoring of database access
* use only one transaction when saving a cache * rework some methods to always take a collection of objects instead of calling the database multiple times
Diffstat (limited to 'tests/src/cgeo/geocaching/cgDataTest.java')
-rw-r--r--tests/src/cgeo/geocaching/cgDataTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java
index d6bb389..3ce6431 100644
--- a/tests/src/cgeo/geocaching/cgDataTest.java
+++ b/tests/src/cgeo/geocaching/cgDataTest.java
@@ -6,6 +6,7 @@ import cgeo.geocaching.enumerations.LoadFlags;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.Viewport;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -51,17 +52,17 @@ public class cgDataTest extends CGeoTestCase {
assertEquals("cgData Test (renamed)", list1.title);
// move to list (cache1=listId2, cache2=listId2)
- app.moveToList(cache1.getGeocode(), listId2);
+ app.moveToList(Collections.singletonList(cache1), listId2);
assertEquals(1, app.getAllStoredCachesCount(false, CacheType.ALL, listId2));
// remove list (cache1=listId2, cache2=listId2)
assertTrue(app.removeList(listId1));
// mark dropped (cache1=1, cache2=0)
- app.markDropped(cache2.getGeocode());
+ app.markDropped(Collections.singletonList(cache2));
// mark stored (cache1=1, cache2=listId2)
- app.markStored(cache2.getGeocode(), listId2);
+ app.markStored(Collections.singletonList(cache2), listId2);
assertEquals(2, app.getAllStoredCachesCount(false, CacheType.ALL, listId2));
// drop stored (cache1=0, cache2=0)