river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r929339 - in /incubator/river/jtsk/trunk: build.xml qa/build.xml src/net/jini/security/policy/DynamicPolicyProvider.java
Date Tue, 30 Mar 2010 23:31:38 GMT
Author: peter_firmstone
Date: Tue Mar 30 23:31:37 2010
New Revision: 929339

URL: http://svn.apache.org/viewvc?rev=929339&view=rev
Log:
Make DynamicPolicyProvider Exception handling conform to Exceptions expected by qa tests.

Modified:
    incubator/river/jtsk/trunk/build.xml
    incubator/river/jtsk/trunk/qa/build.xml
    incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java

Modified: incubator/river/jtsk/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/build.xml?rev=929339&r1=929338&r2=929339&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/build.xml (original)
+++ incubator/river/jtsk/trunk/build.xml Tue Mar 30 23:31:37 2010
@@ -806,7 +806,7 @@
         </jar>
     </target>
 
-        <target name="concurrent-policy-util.jar">
+        <target name="concurrent-policy-util.jar" depends="compile">
         <property name="concurrent-policy-util.deps" 
                 location="${build.deps.dir}/concurrent-policy-util.deps"/>
         <classdep output="${concurrent-policy-util.deps}"

Modified: incubator/river/jtsk/trunk/qa/build.xml
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/build.xml?rev=929339&r1=929338&r2=929339&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/build.xml (original)
+++ incubator/river/jtsk/trunk/qa/build.xml Tue Mar 30 23:31:37 2010
@@ -250,7 +250,7 @@
 
     <target name="run-tests" depends="" description="Execute specific QA test(s)">
         <!--<property name="run.tests" value="com/sun/jini/test/impl/discoverymanager/RemoveGroupsLocsDiscard.td"/>-->
-        <property name="run.tests" value="com/sun/jini/test/impl/locatordiscovery/DelayDiscoveryAfterDiscard.td"/>
+        <property name="run.tests" value="com/sun/jini/test/impl/locatordiscovery/DelayDiscoveryAfterDiscard.td,com/sun/jini/test/spec/policyprovider/dynamicPolicyProvider/SecurityExceptionConstructorNoGetProperty.td,com/sun/jini/test/spec/policyprovider/dynamicPolicyProvider/SecurityExceptionConstructorNoAccessClass.td,com/sun/jini/test/spec/policyprovider/dynamicPolicyProvider/SecurityExceptionConstructorNoAccessClass.td,com/sun/jini/test/spec/policyprovider/dynamicPolicyProvider/SecurityExceptionConstructorNoGetProperty.td"/>
         <!--<property name="run.tests" value="com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.td"/>-->
         <testrun>
             <!-- Run specific test(s) -->

Modified: incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java?rev=929339&r1=929338&r2=929339&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java Tue
Mar 30 23:31:37 2010
@@ -65,18 +65,18 @@ public class DynamicPolicyProvider exten
    
     private static final Logger logger = 
             Logger.getLogger("net.jini.security.policy");
-    
-    /* If true, always grant permission */
-    @SuppressWarnings("unchecked")
-    private static volatile boolean grantAll =
-	((Boolean) AccessController.doPrivileged(
-	    new PrivilegedAction() {
-		public Object run() {
-		    return Boolean.valueOf(
-			Security.getProperty(
-			    "net.jini.security.policy.grantAllandLog"));
-		}
-	    })).booleanValue();
+// Debugging can be done with an SPI implementation    
+//    /* If true, always grant permission */
+//    @SuppressWarnings("unchecked")
+//    private static volatile boolean grantAll =
+//	((Boolean) AccessController.doPrivileged(
+//	    new PrivilegedAction() {
+//		public Object run() {
+//		    return Boolean.valueOf(
+//			Security.getProperty(
+//			    "net.jini.security.policy.grantAllandLog"));
+//		}
+//	    })).booleanValue();
             
     private static final String basePolicyClassProperty =
 	"net.jini.security.policy." +
@@ -113,15 +113,15 @@ public class DynamicPolicyProvider exten
             throw new PolicyInitializationException(
                     "Unable to create a new instance of: " +
                     cname, ex);
-        } catch (SecurityException ex) {
-            if (logger.isLoggable(Level.SEVERE)){
-                logger.log(Level.SEVERE,
-                        "You don't have sufficient permissions to create" +
-                        "a new instance of" + cname, ex);
-            }
-            throw new PolicyInitializationException(
-                    "Unable to create a new instance of: " +
-                    cname, ex);
+//        } catch (SecurityException ex) {
+//            if (logger.isLoggable(Level.SEVERE)){
+//                logger.log(Level.SEVERE,
+//                        "You don't have sufficient permissions to create" +
+//                        "a new instance of" + cname, ex);
+//            }
+//            throw new PolicyInitializationException(
+//                    "Unable to create a new instance of: " +
+//                    cname, ex);
         } 
         return basePolicy;
     }
@@ -283,17 +283,19 @@ public class DynamicPolicyProvider exten
      */
     @Override
     public boolean implies(ProtectionDomain domain, Permission permission) {
-        if (grantAll == false) {
-            return instance.implies(domain, permission);
-        }
-        boolean result = instance.implies(domain, permission);
-        if (result == false){
-            logger.logp(Level.INFO, "instance.getClass().getName()",
-                    "implies(ProtectionDomain domain, Permission permission",
-                    "domain.toString(), permission.toString() returned false");
-            return true;
-        }
-        return result;
+          return instance.implies(domain, permission);
+// Debugging can be done with an SPI implementation.
+//        if (grantAll == false) {
+//            return instance.implies(domain, permission);
+//        }
+//        boolean result = instance.implies(domain, permission);
+//        if (result == false){
+//            logger.logp(Level.INFO, "instance.getClass().getName()",
+//                    "implies(ProtectionDomain domain, Permission permission",
+//                    "domain.toString(), permission.toString() returned false");
+//            return true;
+//        }
+//        return result;
     }
     
     @Override



Mime
View raw message