You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/09/07 10:20:26 UTC

svn commit: r812033 - in /ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test: AuthorizationTests.java DaTest2.groovy

Author: jleroux
Date: Mon Sep  7 08:20:26 2009
New Revision: 812033

URL: http://svn.apache.org/viewvc?rev=812033&view=rev
Log:
ASL2 headers, I guess it's OK now, to check see http://ci.apache.org/projects/ofbiz/rat-output.txt

Modified:
    ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java
    ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy

Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java?rev=812033&r1=812032&r2=812033&view=diff
==============================================================================
--- ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java (original)
+++ ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java Mon Sep  7 08:20:26 2009
@@ -1,3 +1,21 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
 package org.ofbiz.securityext.test;
 
 import java.util.Map;
@@ -13,11 +31,11 @@
 
     private static final String module = AuthorizationTests.class.getName();
     protected Authorization security = null;
-    
+
     public AuthorizationTests(String name) {
         super(name);
     }
-    
+
     @Override
     public void setUp() throws SecurityConfigurationException {
         if (security == null) {
@@ -25,55 +43,55 @@
         }
         AbstractAuthorization.clearThreadLocal();
     }
-                   
+
     public void testBasicAdminPermission() throws Exception {
         Debug.logInfo("Running testBasicAdminPermission()", module);
         assertTrue("User was not granted permission as expected", security.hasPermission("system", "access:foo:bar", null));
     }
-    
+
     public void testBasePermissionFailure() throws Exception {
         Debug.logInfo("Running testBasePermissionFailure()", module);
         assertFalse("Permission did not fail as expected", security.hasPermission("system", "no:permission", null));
     }
-            
+
     public void testDynamicAccessFromClasspath() throws Exception {
         Debug.logInfo("Running testDynamicAccessFromClasspath()", module);
         assertTrue("User was not granted dynamic access as expected", security.hasPermission("system", "test:groovy2:2000", null));
     }
-    
+
     public void testDynamicAccessService() throws Exception {
         Debug.logInfo("Running testDynamicAccessService()", module);
         assertTrue("User was not granted dynamic access as expected", security.hasPermission("system", "test:service:2000", null));
     }
-    
+
     public void testDynamicAccessFailure() throws Exception {
         Debug.logInfo("Running testDynamicAccessFailure()", module);
         assertFalse("Dynamic access did not fail as expected", security.hasPermission("system", "test:groovy1:2000", null));
     }
-    
+
     public void testAutoGrantPermissions() throws Exception {
         Debug.logInfo("Running testDynamicAccessFailure()", module);
-        
+
         // first verify the user does not have the initial permission
         assertFalse("User already has the auto-granted permission", security.hasPermission("system", "test:autogranted", null));
-        
+
         // next run security check to setup the auto-grant
         assertTrue("User was not granted dynamic access as expected", security.hasPermission("system", "test:groovy1:1000", null));
-        
+
         // as long as this runs in the same thread (and it should) access should now be granted
         assertTrue("User was not auto-granted expected permission", security.hasPermission("system", "test:autogranted", null));
     }
-    
+
     public void testAutoGrantCleanup() throws Exception {
         Debug.logInfo("Running testAutoGrantCleanup()", module);
         assertFalse("User was auto-granted an unexpected permission", security.hasPermission("user", "test:autogranted", null));
     }
-    
+
     public void testDynamicAccessRecursion() throws Exception {
         Debug.logInfo("Running testDynamicAccessRecursion()", module);
         assertFalse("User was granted an unexpected permission", security.hasPermission("user", "test:recursion", null));
     }
-    
+
     public void testFindAllPermissionRegexp() throws Exception {
         Debug.logInfo("Running testFindAllPermissionRegexp()", module);
         Map<String,Boolean> permResultMap = security.findMatchingPermission("system", ".*:example", null);
@@ -84,7 +102,7 @@
         assertTrue("User was not granted expected permission {update:example}", permResultMap.get("update:example"));
         assertTrue("User was not granted expected permission {delete:example}", permResultMap.get("delete:example"));
     }
-    
+
     public void testFindLimitedPermissionRegexp() throws Exception {
         Debug.logInfo("Running testFindLimitedPermissionRegexp()", module);
         Map<String,Boolean> permResultMap = security.findMatchingPermission("user", "(access|read):example", null);

Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy?rev=812033&r1=812032&r2=812033&view=diff
==============================================================================
--- ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy (original)
+++ ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/DaTest2.groovy Mon Sep  7 08:20:26 2009
@@ -1,4 +1,23 @@
-package org.ofbiz.securityext.test;
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+
+ package org.ofbiz.securityext.test;
 
 import org.ofbiz.base.util.Debug;
 
@@ -9,4 +28,4 @@
 }
 
 Debug.logInfo("Did not match expected requirements; returning false", "groovy");
-return false;
\ No newline at end of file
+return false;