diff options
Diffstat (limited to 'tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java')
-rw-r--r-- | tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java b/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java index df8dc1f..eaac181 100644 --- a/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java +++ b/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java @@ -12,7 +12,9 @@ import cgeo.geocaching.files.GPX10Parser; import cgeo.geocaching.files.ParserException; import cgeo.geocaching.list.StoredList; +import android.content.ContentResolver; import android.content.res.Resources; +import android.net.Uri; import android.test.InstrumentationTestCase; import java.io.File; @@ -28,7 +30,7 @@ public abstract class AbstractResourceInstrumentationTestCase extends Instrument protected static void removeCacheCompletely(final String geocode) { final EnumSet<RemoveFlag> flags = EnumSet.copyOf(LoadFlags.REMOVE_ALL); - flags.add(RemoveFlag.REMOVE_OWN_WAYPOINTS_ONLY_FOR_TESTING); + flags.add(RemoveFlag.OWN_WAYPOINTS_ONLY_FOR_TESTING); DataStore.removeCache(geocode, flags); } @@ -102,4 +104,9 @@ public abstract class AbstractResourceInstrumentationTestCase extends Instrument instream.close(); } } + + protected Uri getResourceURI(int resId) { + Resources resources = getInstrumentation().getContext().getResources(); + return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + resources.getResourcePackageName(resId) + '/' + resources.getResourceTypeName(resId) + '/' + resources.getResourceEntryName(resId)); + } } |