From be87c2b9e942dd56a3e23f86255b0c1168150bc8 Mon Sep 17 00:00:00 2001 From: bae Date: Tue, 7 Sep 2010 16:54:39 +0400 Subject: [PATCH] 6972495: javax/imageio/CachePremissionsTest/CachePermissionsTest.java failed Reviewed-by: prr --- .../CachePermissionsTest.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java b/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java index edcfcb424..a76561c2f 100644 --- a/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java +++ b/test/javax/imageio/CachePremissionsTest/CachePermissionsTest.java @@ -50,9 +50,9 @@ * -Djava.security.debug=access can be used to verify file permissions. * * @run main CachePermissionsTest true - * @run main/othervm/policy=w.policy CachePermissionsTest false - * @run main/othervm/policy=rw.policy CachePermissionsTest false - * @run main/othervm/policy=rwd.policy CachePermissionsTest true + * @run main/othervm CachePermissionsTest false w.policy + * @run main/othervm CachePermissionsTest false rw.policy + * @run main/othervm CachePermissionsTest true rwd.policy */ import java.io.File; @@ -73,6 +73,17 @@ public class CachePermissionsTest { System.out.println("java.io.tmpdir is " + System.getProperty("java.io.tmpdir")); + if (args.length > 1) { + String testsrc = System.getProperty("test.src", "."); + String policy = testsrc + File.separator + args[1]; + + System.out.println("Policy file: " + policy); + System.setProperty("java.security.policy", policy); + + System.out.println("Install security manager..."); + System.setSecurityManager(new SecurityManager()); + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { -- GitLab