harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r487162 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SecurityManagerTest.java
Date Thu, 14 Dec 2006 10:27:29 GMT
Author: varlax
Date: Thu Dec 14 02:27:29 2006
New Revision: 487162

URL: http://svn.apache.org/viewvc?view=rev&rev=487162
Log:
Reverted SecurityManagerTest changes to allow j9 pass on WinXP

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SecurityManagerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SecurityManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SecurityManagerTest.java?view=diff&rev=487162&r1=487161&r2=487162
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SecurityManagerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/SecurityManagerTest.java
Thu Dec 14 02:27:29 2006
@@ -166,12 +166,18 @@
     private static class checkPermissionLjava_security_PermissionTesting {
         public static void main(String[] args) {
             MutableSecurityManager sm = new MutableSecurityManager();
+            sm.addPermission(MutableSecurityManager.SET_SECURITY_MANAGER);
             System.setSecurityManager(sm);
             try {
-                System.getSecurityManager().checkPermission(
-                    new RuntimePermission("createClassLoader"));
-                fail("This should throw a SecurityException");
-            } catch (SecurityException ok) {}
+                try {
+                    System.getSecurityManager().checkPermission(
+                            new RuntimePermission("createClassLoader"));
+                    fail("This should throw a SecurityException");
+                } catch (SecurityException e) {
+                }
+            } finally {
+                System.setSecurityManager(null);
+            }
         }
     }
 



Mime
View raw message