changeset 4795:022540b11147

7115744: Do not call File::deleteOnExit in security tests Reviewed-by: xuelei
author weijun
date Mon, 28 Nov 2011 18:16:29 +0800
parents e5ecbf555679
children d1928ae4e0a2
files test/sun/security/krb5/auto/CrossRealm.java test/sun/security/krb5/auto/HttpNegotiateServer.java test/sun/security/krb5/auto/KDC.java test/sun/security/krb5/auto/OkAsDelegateXRealm.java test/sun/security/krb5/auto/OneKDC.java test/sun/security/krb5/auto/SSL.java test/sun/security/krb5/auto/W83.java test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngineResult/Deserialize.java
diffstat 8 files changed, 0 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/security/krb5/auto/CrossRealm.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/CrossRealm.java	Mon Nov 28 18:16:29 2011 +0800
@@ -65,7 +65,6 @@
                 "forwardable=true",
                 "[domain_realm]",
                 ".snake.hole=SNAKE.HOLE");
-        new File("krb5-localkdc.conf").deleteOnExit();
         System.setProperty("java.security.krb5.conf", "krb5-localkdc.conf");
     }
 
@@ -73,7 +72,6 @@
         Security.setProperty("auth.login.defaultCallbackHandler", "CrossRealm");
         System.setProperty("java.security.auth.login.config", "jaas-localkdc.conf");
         System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
-        new File("jaas-localkdc.conf").deleteOnExit();
         FileOutputStream fos = new FileOutputStream("jaas-localkdc.conf");
         fos.write(("com.sun.security.jgss.krb5.initiate {\n" +
                 "    com.sun.security.auth.module.Krb5LoginModule\n" +
--- a/test/sun/security/krb5/auto/HttpNegotiateServer.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/HttpNegotiateServer.java	Mon Nov 28 18:16:29 2011 +0800
@@ -178,7 +178,6 @@
                 "    com.sun.security.auth.module.Krb5LoginModule required;\n};\n"
                 ).getBytes());
         fos.close();
-        f.deleteOnExit();
 
         HttpServer h1 = httpd("Negotiate", false,
                 "HTTP/" + WEB_HOST + "@" + REALM_WEB, KRB5_TAB);
--- a/test/sun/security/krb5/auto/KDC.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/KDC.java	Mon Nov 28 18:16:29 2011 +0800
@@ -1071,7 +1071,6 @@
                 }
                 cache.update(credentials);
                 cache.save();
-                new File(ccache).deleteOnExit();
             }
 
             return result;
--- a/test/sun/security/krb5/auto/OkAsDelegateXRealm.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/OkAsDelegateXRealm.java	Mon Nov 28 18:16:29 2011 +0800
@@ -109,9 +109,6 @@
 
         System.setProperty("java.security.auth.login.config", "jaas-localkdc.conf");
 
-        new File("krb5-localkdc.conf").deleteOnExit();
-        new File("localkdc.ktab").deleteOnExit();
-        new File("jaas-localkdc.conf").deleteOnExit();
         Config.refresh();
 
         Context c = Context.fromJAAS("com.sun.security.jgss.krb5.initiate");
--- a/test/sun/security/krb5/auto/OneKDC.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/OneKDC.java	Mon Nov 28 18:16:29 2011 +0800
@@ -76,8 +76,6 @@
         Config.refresh();
 
         writeKtab(KTAB);
-        new File(KRB5_CONF).deleteOnExit();
-        new File(KTAB).deleteOnExit();
     }
 
     /**
@@ -114,7 +112,6 @@
                 "    isInitiator=false;\n};\n"
                 ).getBytes());
         fos.close();
-        f.deleteOnExit();
         Security.setProperty("auth.login.defaultCallbackHandler", "OneKDC$CallbackForClient");
     }
 
--- a/test/sun/security/krb5/auto/SSL.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/SSL.java	Mon Nov 28 18:16:29 2011 +0800
@@ -96,7 +96,6 @@
                 "    storeKey=true;\n};\n"
                 ).getBytes());
         fos.close();
-        f.deleteOnExit();
 
         Context c;
         final Context s = Context.fromJAAS("ssl");
--- a/test/sun/security/krb5/auto/W83.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/krb5/auto/W83.java	Mon Nov 28 18:16:29 2011 +0800
@@ -52,8 +52,6 @@
         Config.refresh();
 
         kdc.writeKtab(OneKDC.KTAB);
-        new File(OneKDC.KRB5_CONF).deleteOnExit();
-        new File(OneKDC.KTAB).deleteOnExit();
 
         KeyTab ktab = KeyTab.getInstance(OneKDC.KTAB);
         for (int etype: EType.getBuiltInDefaults()) {
--- a/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngineResult/Deserialize.java	Fri Nov 25 13:46:28 2011 +0000
+++ b/test/sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngineResult/Deserialize.java	Mon Nov 28 18:16:29 2011 +0800
@@ -42,7 +42,6 @@
         SSLEngineResult.Status obj = SSLEngineResult.Status.OK;
 
         File file = new File("deserial-test-file");
-        file.deleteOnExit();
 
         ObjectOutputStream oos = new ObjectOutputStream(
             new FileOutputStream(file));