harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r527776 - in /harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar: AttributesTest.java JarEntryTest.java
Date Thu, 12 Apr 2007 05:35:35 GMT
Author: pyang
Date: Wed Apr 11 22:35:34 2007
New Revision: 527776

URL: http://svn.apache.org/viewvc?view=rev&rev=527776
Log:
Apply patch for HARMONY-3621( [classlib][archive] Add test for java.util.jar.Attributes.hashCode(
) and java.util.jar.JarEntry( JarEntry ))

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java
    harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java?view=diff&rev=527776&r1=527775&r2=527776
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java
Wed Apr 11 22:35:34 2007
@@ -289,5 +289,19 @@
         assertEquals(2, attribute.size());
         assertNull(attribute.get(name));
     }
+    
+    /**
+     * @tests java.util.jar.Attributes.hashCode()
+     */
+    public void test_hashCode() {
+        MockAttributes mockAttr = new MockAttributes();
+        mockAttr.putValue("1", "one");
+        assertEquals(mockAttr.getMap().hashCode(), mockAttr.hashCode());
+    }
 
+    private static class MockAttributes extends Attributes {
+        public Map<Object, Object> getMap() {
+            return map;
+        }
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java?view=diff&rev=527776&r1=527775&r2=527776
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java
Wed Apr 11 22:35:34 2007
@@ -62,6 +62,23 @@
             jarFile.close();
         }
     }
+    
+    /**
+     * @throws IOException
+     * @tests java.util.jar.JarEntry#JarEntry(java.util.jar.JarEntry)
+     */
+    public void test_ConstructorLjava_util_jar_JarEntry() throws IOException {
+        JarEntry newJarEntry = new JarEntry(jarFile.getJarEntry(entryName));
+        assertNotNull(newJarEntry);
+
+        jarEntry = null;
+        try {
+            newJarEntry = new JarEntry(jarEntry);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+    }
 
     /**
      * @tests java.util.jar.JarEntry#JarEntry(java.util.zip.ZipEntry)



Mime
View raw message