harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r434304 - /incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/impl/java/org/apache/harmony/crypto/utils/AlgNameMapperTest.java
Date Thu, 24 Aug 2006 05:30:21 GMT
Author: mloenko
Date: Wed Aug 23 22:30:17 2006
New Revision: 434304

URL: http://svn.apache.org/viewvc?rev=434304&view=rev
Log:
applied patch for HARMONY-1268
Regression test for HARMONY-1185

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/impl/java/org/apache/harmony/crypto/utils/AlgNameMapperTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/impl/java/org/apache/harmony/crypto/utils/AlgNameMapperTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/impl/java/org/apache/harmony/crypto/utils/AlgNameMapperTest.java?rev=434304&r1=434303&r2=434304&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/impl/java/org/apache/harmony/crypto/utils/AlgNameMapperTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/crypto/src/test/impl/java/org/apache/harmony/crypto/utils/AlgNameMapperTest.java
Wed Aug 23 22:30:17 2006
@@ -45,4 +45,24 @@
         assertFalse(AlgNameMapper.isOID(badOID));
         assertFalse(AlgNameMapper.isOID(notOID));
     }
+
+    /**
+     * @tests org.apache.harmony.crypto.utils.AlgNameMapper.selectEntries(Provider)
+     */
+    public void testSelectEntries() {
+        // Regression for HARMONY-1185
+        String algStandardName = "SHA1withRSA";
+        String hardcodedOID = "1.2.840.113549.1.1.5";
+        String alternativeName = "SHA1WithRSAEncryption";
+        String anotherAlgStandardName = "SHA1withDSA";
+        String alternativeOID = "1.3.14.3.2.13";
+        assertEquals(hardcodedOID, AlgNameMapper.map2OID(algStandardName));
+        assertEquals(algStandardName, AlgNameMapper.map2AlgName(hardcodedOID));
+
+        // Mappings taken from a provider that do not override any of hardcoded
+        // mappings should not be rejected.
+        assertEquals(hardcodedOID, AlgNameMapper.map2OID(alternativeName));
+        assertEquals(anotherAlgStandardName, AlgNameMapper
+                .map2AlgName(alternativeOID));
+    }
 }



Mime
View raw message