harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r525013 - /harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java
Date Tue, 03 Apr 2007 03:33:34 GMT
Author: smishura
Date: Mon Apr  2 20:33:34 2007
New Revision: 525013

URL: http://svn.apache.org/viewvc?view=rev&rev=525013
Log:
Apply patch for HARMONY-3540:
([classlib][security]MessageDigest.update(ByteBuffer) missing testcases.)

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java?view=diff&rev=525013&r1=525012&r2=525013
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java
Mon Apr  2 20:33:34 2007
@@ -17,6 +17,7 @@
 
 package org.apache.harmony.security.tests.java.security;
 
+import java.nio.ByteBuffer;
 import java.security.DigestException;
 import java.security.MessageDigest;
 
@@ -99,6 +100,21 @@
         byte[] b = { 1, 2, 3, 4, 5 };
         md.update(b);
         assertTrue(md.runEngineUpdate2);
+    }
+
+    /**
+     * @tests java.security.MessageDigest#update(ByteBuffer)
+     */
+    public void test_updateLjava_nio_ByteBuffer() {
+        MyMessageDigest1 md = new MyMessageDigest1("ABC");
+        byte[] b = { 1, 2, 3, 4, 5 };
+        ByteBuffer byteBuffer = ByteBuffer.wrap(b);
+
+        int limit = byteBuffer.limit();
+        md.update(byteBuffer);
+        assertTrue(md.runEngineUpdate2);
+        assertEquals(byteBuffer.limit(), byteBuffer.position());
+        assertEquals(limit, byteBuffer.limit());
     }
 
     /**



Mime
View raw message