harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r466095 - in /incubator/harmony/enhanced/classlib/trunk/modules/tools/src: main/java/org/apache/harmony/tools/toolutils/KeyStoreLoaderSaver.java test/java/org/apache/harmony/tools/toolutils/tests/KeyStoreLoaderSaverTest.java
Date Fri, 20 Oct 2006 12:47:18 GMT
Author: smishura
Date: Fri Oct 20 05:47:14 2006
New Revision: 466095

URL: http://svn.apache.org/viewvc?view=rev&rev=466095
Log:
Apply patch for HARMONY-1927 ([classlib][tools] KeyStoreLoaderSaver.saveStore(..) throws unhandled
IllegalArgumentException)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/toolutils/KeyStoreLoaderSaver.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/test/java/org/apache/harmony/tools/toolutils/tests/KeyStoreLoaderSaverTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/toolutils/KeyStoreLoaderSaver.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/toolutils/KeyStoreLoaderSaver.java?view=diff&rev=466095&r1=466094&r2=466095
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/toolutils/KeyStoreLoaderSaver.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/toolutils/KeyStoreLoaderSaver.java
Fri Oct 20 05:47:14 2006
@@ -159,6 +159,8 @@
             ksFile = new File(uri);
         } catch (URISyntaxException e) {
             ksFile = new File(storePath);
+        } catch (IllegalArgumentException e) {
+            ksFile = new File(storePath);
         }
         
         // the file will be created if and only if one with the same name

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/test/java/org/apache/harmony/tools/toolutils/tests/KeyStoreLoaderSaverTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/test/java/org/apache/harmony/tools/toolutils/tests/KeyStoreLoaderSaverTest.java?view=diff&rev=466095&r1=466094&r2=466095
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/test/java/org/apache/harmony/tools/toolutils/tests/KeyStoreLoaderSaverTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/test/java/org/apache/harmony/tools/toolutils/tests/KeyStoreLoaderSaverTest.java
Fri Oct 20 05:47:14 2006
@@ -17,7 +17,9 @@
 
 package org.apache.harmony.tools.toolutils.tests;
 
+import java.io.File;
 import java.io.IOException;
+import java.security.KeyStore;
 
 import junit.framework.TestCase;
 
@@ -42,6 +44,27 @@
             // IOException must be thrown, because file does not exist
             fail("No expected IOException");
         } catch (IOException ok) {
+        }
+    }
+    
+    /**
+     * @tests 'KeyStoreLoaderSaver.saveStore(KeyStore, String, char[], boolean)'
+     */
+    public void testSaveStore() throws Exception {
+
+        // Regression for HARMONY-1927
+        // create a path to save the store to
+        String tempDir = System.getProperty("java.io.tmpdir")
+                + File.separatorChar;
+        String keyStorePath = tempDir + "SaveStoreTestTemporaryFile";
+        try {
+            KeyStore keyStore = KeyStoreLoaderSaver.loadStore(null, "BKS",
+                    "pwd".toCharArray(), null);
+
+            KeyStoreLoaderSaver.saveStore(keyStore, keyStorePath, "pwd"
+                    .toCharArray(), false);
+        } finally {
+            new File(keyStorePath).delete();
         }
     }
 }



Mime
View raw message