diff options
author | Tobias Thierer <tobiast@google.com> | 2018-04-20 07:07:18 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-04-20 07:07:18 -0700 |
commit | b04d792414fa7228f6844d2496f681bccb886ae3 (patch) | |
tree | 90b7beba22c434a8f70ded8a1496bffe4bff6787 | |
parent | 5f2b8d51d8f15935cbb5a45436f65ee7bd1b07de (diff) | |
parent | 1c45c4b2d2f027b4f531470b80d9d011c9d33985 (diff) |
Merge "Delete JarFileTest.testGetJarEntry()." am: 3bc40624dc
am: 1c45c4b2d2
Change-Id: If6f6794913ab6bd76717adb26a885960c88e6a33
-rw-r--r-- | harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java index 89ed576a91..c8c5da9600 100644 --- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java +++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java @@ -378,87 +378,6 @@ public class JarFileTest extends TestCase { } } - - /** - * java.util.jar.JarFile#getJarEntry(java.lang.String) - */ - public void testGetJarEntry() throws Exception { - File file = Support_Resources.copyFile(resources, null, jarName); - JarFile jarFile = new JarFile(file); - assertEquals("Error in returned entry", 311, jarFile.getEntry( - entryName).getSize()); - jarFile.close(); - - // tests for signed jars - // test all signed jars in the /Testres/Internal/SignedJars directory - String jarDirUrl = Support_Resources - .getResourceURL("/../internalres/signedjars"); - Vector<String> signedJars = new Vector<String>(); - try { - InputStream is = new URL(jarDirUrl + "/jarlist.txt").openStream(); - while (is.available() > 0) { - StringBuilder linebuff = new StringBuilder(80); // Typical line - // length - done: while (true) { - int nextByte = is.read(); - switch (nextByte) { - case -1: - break done; - case (byte) '\r': - if (linebuff.length() == 0) { - // ignore - } - break done; - case (byte) '\n': - if (linebuff.length() == 0) { - // ignore - } - break done; - default: - linebuff.append((char) nextByte); - } - } - if (linebuff.length() == 0) { - break; - } - String line = linebuff.toString(); - signedJars.add(line); - } - is.close(); - } catch (IOException e) { - // no list of jars found - } - - for (int i = 0; i < signedJars.size(); i++) { - String jarName = signedJars.get(i); - try { - file = Support_Resources.getExternalLocalFile(jarDirUrl - + "/" + jarName); - jarFile = new JarFile(file, true); - boolean foundCerts = false; - Enumeration<JarEntry> e = jarFile.entries(); - while (e.hasMoreElements()) { - JarEntry entry = e.nextElement(); - InputStream is = jarFile.getInputStream(entry); - is.skip(100000); - is.close(); - Certificate[] certs = entry.getCertificates(); - if (certs != null && certs.length > 0) { - foundCerts = true; - break; - } - } - assertTrue( - "No certificates found during signed jar test for jar \"" - + jarName + "\"", foundCerts); - jarFile.close(); - } catch (IOException e) { - fail("Exception during signed jar test for jar \"" + jarName - + "\": " + e.toString()); - } - } - } - /** * java.util.jar.JarFile#getManifest() */ |