diff options
author | Jorg Pleumann <> | 2009-04-07 11:33:16 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-07 11:33:16 -0700 |
commit | 1b965e80442efbf1802adb7113749c385c7466ea (patch) | |
tree | 82755875fec628b26020a063bd4137e885724027 /archive/src | |
parent | 051f400949489d012498f575c0a40999ad7a4f54 (diff) | |
download | libcore-1b965e80442efbf1802adb7113749c385c7466ea.zip libcore-1b965e80442efbf1802adb7113749c385c7466ea.tar.gz libcore-1b965e80442efbf1802adb7113749c385c7466ea.tar.bz2 |
AI 144826: am: CL 144821 am: CL 144818 Bringing archive down to zero broken tests.
Original author: jorgp
Merged from: //branches/cupcake/...
Original author: android-build
Automated import of CL 144826
Diffstat (limited to 'archive/src')
-rw-r--r-- | archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java index 468a803..5530a2e 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java @@ -324,11 +324,9 @@ public class ZipFileTest extends junit.framework.TestCase { @TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, - notes = "Strange test that succeeds in Android but not against RI.", method = "getEntry", args = {java.lang.String.class} ) - @BrokenTest("Needs investigation. AndroidOnly?") public void test_getEntryLjava_lang_String_AndroidOnly() throws IOException { java.util.zip.ZipEntry zentry = zfile.getEntry("File1.txt"); assertNotNull("Could not obtain ZipEntry", zentry); @@ -336,12 +334,18 @@ public class ZipFileTest extends junit.framework.TestCase { InputStream in; zentry = zfile.getEntry("testdir1"); - assertNotNull("Could not obtain ZipEntry: testdir1", zentry); + assertNotNull("Must be able to obtain ZipEntry: testdir1", zentry); in = zfile.getInputStream(zentry); - assertNotNull("testdir1 should not have null input stream", in); - r = in.read(); - in.close(); - assertEquals("testdir1 should not contain data", -1, r); + /* + * Android delivers empty InputStream, RI no InputStream at all. The + * spec doesn't clarify this, so we need to deal with both situations. + */ + int data = -1; + if (in != null) { + data = in.read(); + in.close(); + } + assertEquals("Must not be able to read directory data", -1, data); } @TestTargetNew( |