harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r420778 - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/java/security/SecureRandom.java test/api/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java
Date Tue, 11 Jul 2006 09:49:38 GMT
Author: mloenko
Date: Tue Jul 11 02:49:38 2006
New Revision: 420778

URL: http://svn.apache.org/viewvc?rev=420778&view=rev
Log:
fixes for HARMONY-750
[classlib][security] java.security.SecureRandom.getAlgorithm() returns "null" instead of "unknown"

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java?rev=420778&r1=420777&r2=420778&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureRandom.java
Tue Jul 11 02:49:38 2006
@@ -145,7 +145,7 @@
      */
     protected SecureRandom(SecureRandomSpi secureRandomSpi,
                            Provider provider) {
-        this(secureRandomSpi, provider, null);
+        this(secureRandomSpi, provider, "unknown");
     }
     
     // Constructor
@@ -154,7 +154,7 @@
                          String algorithm) {
         super(0);
         this.provider = provider;
-        this. algorithm = algorithm;
+        this.algorithm = algorithm;
         this.secureRandomSpi = secureRandomSpi;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java?rev=420778&r1=420777&r2=420778&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java
Tue Jul 11 02:49:38 2006
@@ -19,6 +19,7 @@
 import java.security.NoSuchProviderException;
 import java.security.Provider;
 import java.security.SecureRandom;
+import java.security.SecureRandomSpi;
 import java.security.Security;
 
 public class SecureRandom2Test extends junit.framework.TestCase {
@@ -147,4 +148,26 @@
 			fail("seed generation with long failed : " + e);
 		}
 	}
-}
\ No newline at end of file
+
+	/**
+     * @tests java.security.SecureRandom#getAlgorithm()
+     */
+    public void test_getAlgorithm() {
+        // Regression for HARMONY-750
+        
+        SecureRandomSpi spi = new SecureRandomSpi() {
+
+            protected void engineSetSeed(byte[] arg) {}
+
+            protected void engineNextBytes(byte[] arg) {}
+
+            protected byte[] engineGenerateSeed(int arg) {
+                return null;
+            }
+        };
+
+        SecureRandom sr = new SecureRandom(spi, null) {};
+        
+        assertEquals("unknown", sr.getAlgorithm());
+    }
+}



Mime
View raw message