summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2009-09-30 15:09:17 -0700
committerJesse Wilson <jessewilson@google.com>2009-09-30 15:09:17 -0700
commitd9e5b6ec4f9c2c3d750b0b89c3c4410f51fd4e8e (patch)
tree6c9dcb803967bf887bccbfc075854e2a5e6b437c
parentcbb67b37b1a0223097763f84ebae072eca183164 (diff)
downloadlibcore-d9e5b6ec4f9c2c3d750b0b89c3c4410f51fd4e8e.zip
libcore-d9e5b6ec4f9c2c3d750b0b89c3c4410f51fd4e8e.tar.gz
libcore-d9e5b6ec4f9c2c3d750b0b89c3c4410f51fd4e8e.tar.bz2
Fixing a lame test that was relying on hashmap iteration order.
-rw-r--r--luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java b/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java
index 8303db3..7a67bf8 100644
--- a/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java
+++ b/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java
@@ -34,6 +34,8 @@ import java.security.cert.Certificate;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
@@ -151,8 +153,7 @@ public class JarURLConnectionTest extends junit.framework.TestCase {
args = {}
)
public void test_getManifest() throws Exception {
-
- String [] expected = {"plus.bmp", "swt.dll"};
+
//URL u = new URL("jar:"
// + BASE.toString()+"/lf.jar!/swt.dll");
@@ -161,15 +162,9 @@ public class JarURLConnectionTest extends junit.framework.TestCase {
juc = (JarURLConnection) u.openConnection();
Manifest manifest = juc.getManifest();
Map<String, Attributes> attr = manifest.getEntries();
- assertEquals(expected.length, attr.size());
- Set<String> keys = attr.keySet();
- String [] result = new String[expected.length];
- keys.toArray(result);
+ assertEquals(new HashSet<String>(Arrays.asList("plus.bmp", "swt.dll")),
+ attr.keySet());
- for(int i = 0; i < result.length; i++) {
- assertEquals(expected[i], result[i]);
- }
-
//URL invURL = new URL("jar:"
// + BASE.toString()+"/InvalidJar.jar!/Test.class");