aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java')
-rw-r--r--tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java b/tests/src/cgeo/geocaching/test/AbstractResourceInstrumentationTestCase.java
index df8dc1f..cbad794 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;
@@ -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));
+ }
}