harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r494741 - in /harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security: Policy2Test.java PolicyTest.java
Date Wed, 10 Jan 2007 06:44:38 GMT
Author: smishura
Date: Tue Jan  9 22:44:37 2007
New Revision: 494741

URL: http://svn.apache.org/viewvc?view=rev&rev=494741
Log:
Merge tests PolicyTest and Policy2Test

Removed:
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Policy2Test.java
Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java?view=diff&rev=494741&r1=494740&r2=494741
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
Tue Jan  9 22:44:37 2007
@@ -21,7 +21,12 @@
 */
 
 package org.apache.harmony.security.tests.java.security;
-import java.security.*;
+
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.security.SecurityPermission;
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.HashSet;
@@ -30,12 +35,9 @@
 
 import org.apache.harmony.security.tests.support.SecurityChecker;
 
-
 /**
  * Tests for <code>Policy</code>
- * 
  */
-
 public class PolicyTest extends TestCase {
 
     public static void main(String[] args) {
@@ -43,9 +45,9 @@
     }
 
     /**
-     * Tests that setPolicy() is properly secured via SecurityManager.
+     * @tests java.security.Policy#setPolicy(java.security.Policy)
      */
-    public void testSetPolicy() {
+    public void test_setPolicyLjava_security_Policy() {
         SecurityManager old = System.getSecurityManager();
         Policy oldPolicy = Policy.getPolicy();
         try {
@@ -71,11 +73,14 @@
     }
 
     /**
-     * Tests that getPolicy() is properly secured via SecurityManager.
+     * @tests java.security.Policy#getPolicy()
      */
-    public void testGetPolicy_CheckPermission() {
+    public void test_getPolicy() {
         SecurityManager old = System.getSecurityManager();
         Policy oldPolicy = Policy.getPolicy();
+
+        assertNotNull("Got a null system security policy", oldPolicy);
+
         try {
             Policy.setPolicy(new TestProvider());
             SecurityChecker checker = new SecurityChecker(



Mime
View raw message