diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2012-11-28 22:02:37 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2012-11-28 22:02:37 +0100 |
commit | d16aab94d82b6241e6b2d5749d49fc1ef1e53283 (patch) | |
tree | 34cdc5c181a3054b369f847cd7563155a2d2059e /tests/src | |
parent | 76c87d3c53c0e9a78c1f1d5d3912f4dcf3955023 (diff) | |
download | cgeo-d16aab94d82b6241e6b2d5749d49fc1ef1e53283.zip cgeo-d16aab94d82b6241e6b2d5749d49fc1ef1e53283.tar.gz cgeo-d16aab94d82b6241e6b2d5749d49fc1ef1e53283.tar.bz2 |
refactoring: use more prepared statements
* improves database performance
* removed some method arguments which were always true
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/cgeo/geocaching/cgDataTest.java | 6 | ||||
-rw-r--r-- | tests/src/cgeo/geocaching/files/GPXImporterTest.java | 2 | ||||
-rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/src/cgeo/geocaching/cgDataTest.java b/tests/src/cgeo/geocaching/cgDataTest.java index 3cee32f..9d1a8e2 100644 --- a/tests/src/cgeo/geocaching/cgDataTest.java +++ b/tests/src/cgeo/geocaching/cgDataTest.java @@ -46,7 +46,7 @@ public class cgDataTest extends CGeoTestCase { // save caches to DB (cache1=listId1, cache2=listId1) app.saveCache(cache1, LoadFlags.SAVE_ALL); app.saveCache(cache2, LoadFlags.SAVE_ALL); - assertTrue(app.getAllStoredCachesCount(false, CacheType.ALL) >= 2); + assertTrue(cgeoapplication.getAllCachesCount() >= 2); // rename list (cache1=listId1, cache2=listId1) assertEquals(1, app.renameList(listId1, "cgData Test (renamed)")); @@ -57,7 +57,7 @@ public class cgDataTest extends CGeoTestCase { // move to list (cache1=listId2, cache2=listId2) app.moveToList(Collections.singletonList(cache1), listId2); - assertEquals(1, app.getAllStoredCachesCount(false, CacheType.ALL, listId2)); + assertEquals(1, app.getAllStoredCachesCount(CacheType.ALL, listId2)); // remove list (cache1=listId2, cache2=listId2) assertTrue(app.removeList(listId1)); @@ -67,7 +67,7 @@ public class cgDataTest extends CGeoTestCase { // mark stored (cache1=1, cache2=listId2) app.markStored(Collections.singletonList(cache2), listId2); - assertEquals(2, app.getAllStoredCachesCount(false, CacheType.ALL, listId2)); + assertEquals(2, app.getAllStoredCachesCount(CacheType.ALL, listId2)); // drop stored (cache1=0, cache2=0) app.removeList(listId2); diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java index da99c11..a7f8a68 100644 --- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java +++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java @@ -279,7 +279,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase { @Override protected void tearDown() throws Exception { - SearchResult search = cgeoapplication.getInstance().getBatchOfStoredCaches(false, null, CacheType.ALL, listId); + SearchResult search = cgeoapplication.getInstance().getBatchOfStoredCaches(null, CacheType.ALL, listId); List<cgCache> cachesInList = new ArrayList<cgCache>(); cachesInList.addAll(search.getCachesFromSearchResult(LoadFlags.LOAD_CACHE_OR_DB)); cgeoapplication.getInstance().markDropped(cachesInList); diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index 693076a..cd4ac61 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -305,7 +305,7 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { @Override protected void tearDown() throws Exception { - SearchResult search = cgeoapplication.getInstance().getBatchOfStoredCaches(false, null, CacheType.ALL, listId); + SearchResult search = cgeoapplication.getInstance().getBatchOfStoredCaches(null, CacheType.ALL, listId); assertNotNull(search); cgeoapplication.getInstance().removeCaches(search.getGeocodes(), LoadFlags.REMOVE_ALL); cgeoapplication.getInstance().removeList(listId); |