From: Earl Ou Date: Fri, 19 Oct 2012 08:49:34 +0000 (+0800) Subject: print image path when setup error in Exif test X-Git-Tag: android-x86-6.0-r3~2044^2~750 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1927ec5dc5ae1d202f6a0e2a55a2e8d834f6ce60;p=android-x86%2Fpackages-apps-Camera2.git print image path when setup error in Exif test Change-Id: Ia4391571695ea518eac53f2b8c6b1a2acb5159c1 --- 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); } }