summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java')
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java b/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
index 5b61778bd..6a4d29e98 100644
--- a/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
+++ b/tests/src/com/android/gallery3d/exif/ExifXmlDataTestCase.java
@@ -63,15 +63,19 @@ public class ExifXmlDataTestCase extends InstrumentationTestCase {
@Override
public void setUp() throws Exception {
- if (mImagePath != null) {
- mImageInputStream = new FileInputStream(mImagePath);
- mXmlInputStream = new FileInputStream(mXmlPath);
- mXmlParser = Xml.newPullParser();
- mXmlParser.setInput(new InputStreamReader(mXmlInputStream));
- } else {
- Resources res = getInstrumentation().getContext().getResources();
- mImageInputStream = res.openRawResource(mImageResourceId);
- mXmlParser = res.getXml(mXmlResourceId);
+ try {
+ if (mImagePath != null) {
+ mImageInputStream = new FileInputStream(mImagePath);
+ mXmlInputStream = new FileInputStream(mXmlPath);
+ mXmlParser = Xml.newPullParser();
+ mXmlParser.setInput(new InputStreamReader(mXmlInputStream));
+ } else {
+ Resources res = getInstrumentation().getContext().getResources();
+ mImageInputStream = res.openRawResource(mImageResourceId);
+ mXmlParser = res.getXml(mXmlResourceId);
+ }
+ } catch (Exception e) {
+ throw new Exception(getImageTitle(), e);
}
}