changeset 8854:e8daf5a83e42

8028377: test/sun/security/provider/KeyStore/DKSTest.sh attempts to write to ${test.src} Reviewed-by: alanb, weijun
author vinnie
date Tue, 19 Nov 2013 15:39:58 +0000
parents 7b71e53c6a2b
children bfd4e632eeda
files test/sun/security/provider/KeyStore/DKSTest.java test/sun/security/provider/KeyStore/domains.cfg
diffstat 2 files changed, 7 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/security/provider/KeyStore/DKSTest.java	Tue Nov 19 14:14:14 2013 +0800
+++ b/test/sun/security/provider/KeyStore/DKSTest.java	Tue Nov 19 15:39:58 2013 +0000
@@ -38,6 +38,7 @@
 public class DKSTest {
 
     private static final String TEST_SRC = System.getProperty("test.src");
+    private static final String USER_DIR = System.getProperty("user.dir");
     private static final String CERT = TEST_SRC + "/../../pkcs12/trusted.pem";
     private static final String CONFIG = "file://" + TEST_SRC + "/domains.cfg";
     private static final Map<String, KeyStore.ProtectionParameter> PASSWORDS =
@@ -60,19 +61,6 @@
         }};
 
     public static void main(String[] args) throws Exception {
-        try {
-            main0();
-        } finally {
-            // cleanup
-            new File(TEST_SRC + "/empty.jks").delete();
-            new File(TEST_SRC + "/Alias.keystore_tmp").delete();
-            new File(TEST_SRC + "/pw.jks_tmp").delete();
-            new File(TEST_SRC + "/secp256r1server-secp384r1ca.p12_tmp").delete();
-            new File(TEST_SRC + "/sect193r1server-rsa1024ca.p12_tmp").delete();
-        }
-    }
-
-    private static void main0() throws Exception {
         /*
          * domain keystore: system
          */
@@ -120,7 +108,7 @@
         empty.load(null, null);
 
         try (OutputStream outStream =
-            new FileOutputStream(TEST_SRC + "/empty.jks")) {
+            new FileOutputStream(new File(USER_DIR, "empty.jks"))) {
             empty.store(outStream, "passphrase".toCharArray());
         }
         config = new URI(CONFIG + "#empty");
--- a/test/sun/security/provider/KeyStore/domains.cfg	Tue Nov 19 14:14:14 2013 +0800
+++ b/test/sun/security/provider/KeyStore/domains.cfg	Tue Nov 19 15:39:58 2013 +0000
@@ -35,14 +35,14 @@
     keystoreType="PKCS12" {
         keystore policy_keystore 
             keystoreType="JKS"
-            keystoreURI="${test.src}/Alias.keystore_tmp";
+            keystoreURI="${user.dir}/Alias.keystore_tmp";
         keystore pw_keystore 
             keystoreType="CaseExactJKS"
-            keystoreURI="${test.src}/pw.jks_tmp";
+            keystoreURI="${user.dir}/pw.jks_tmp";
         keystore eckeystore1
-            keystoreURI="${test.src}/sect193r1server-rsa1024ca.p12_tmp";
+            keystoreURI="${user.dir}/sect193r1server-rsa1024ca.p12_tmp";
         keystore eckeystore2 
-            keystoreURI="${test.src}/secp256r1server-secp384r1ca.p12_tmp";
+            keystoreURI="${user.dir}/secp256r1server-secp384r1ca.p12_tmp";
 };
 
 // domain where passwords are supplied via environment variables
@@ -61,5 +61,5 @@
     keystoreType="JKS"
     keystoreProviderName="SUN" {
         keystore empty
-            keystoreURI="${test.src}/empty.jks";
+            keystoreURI="${user.dir}/empty.jks";
 };