Author: nmalin
Date: Sat Feb  3 14:16:16 2018
New Revision: 1823028

URL: http://svn.apache.org/viewvc?rev=1823028&view=rev
Log:
Improved: complete previous commit to add security in groovy context 
(OFBIZ-10196)
add security on groovy junit test
add security on eclipse and intellij groovy dsl definition
Thanks to Dennis Balkir for the suggest

Modified:
    
ofbiz/ofbiz-framework/trunk/framework/base/groovyScript/test/SimpleTests.groovy
    
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld
    
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
    
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java
    
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java

Modified: 
ofbiz/ofbiz-framework/trunk/framework/base/groovyScript/test/SimpleTests.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/groovyScript/test/SimpleTests.groovy?rev=1823028&r1=1823027&r2=1823028&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/base/groovyScript/test/SimpleTests.groovy 
(original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/base/groovyScript/test/SimpleTests.groovy 
Sat Feb  3 14:16:16 2018
@@ -34,4 +34,8 @@ class BaseTest extends GroovyScriptTestC
     void testDispatcher() {
         assert dispatcher
     }
+
+    void testSecurity() {
+        assert security
+    }
 }

Modified: 
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld?rev=1823028&r1=1823027&r2=1823028&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld
 Sat Feb  3 14:16:16 2018
@@ -22,6 +22,7 @@ contribute(currentType(subType('groovy.l
     property name: 'context', type: 'java.util.Map'
     property name: 'delegator', type: 'org.apache.ofbiz.entity.Delegator'
     property name: 'dispatcher', type: 
'org.apache.ofbiz.service.LocalDispatcher'
+    property name: 'security', type: 'org.apache.ofbiz.security.Security'
 
     method name: 'runService', type: 'java.util.Map', params: [serviceName: 
'String', inputMap: 'java.util.Map']
     method name: 'makeValue', type: 'java.util.Map', params: [entityName: 
'String']

Modified: 
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl?rev=1823028&r1=1823027&r2=1823028&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
 Sat Feb  3 14:16:16 2018
@@ -26,6 +26,7 @@ contributor(groovyContext) {
     property name: 'context', type: 'java.util.Map'
     property name: 'delegator', type: 'org.apache.ofbiz.entity.Delegator'
     property name: 'dispatcher', type: 
'org.apache.ofbiz.service.LocalDispatcher'
+    property name: 'security', type: 'org.apache.ofbiz.security.Security'
 
     method name: 'runService', type: 'java.util.Map', params: [serviceName: 
'String', inputMap: 'java.util.Map']
     method name: 'run', type: 'java.util.Map', params: [args: 'java.util.Map']

Modified: 
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java?rev=1823028&r1=1823027&r2=1823028&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/GroovyScriptTestCase.java
 Sat Feb  3 14:16:16 2018
@@ -20,12 +20,14 @@ package org.apache.ofbiz.testtools;
 
 import groovy.util.GroovyTestCase;
 import org.apache.ofbiz.entity.Delegator;
+import org.apache.ofbiz.security.Security;
 import org.apache.ofbiz.service.LocalDispatcher;
 
 public class GroovyScriptTestCase extends GroovyTestCase {
 
     public Delegator delegator;
     public LocalDispatcher dispatcher;
+    public Security security;
 
     public void setDelegator(Delegator delegator) {
         this.delegator = delegator;
@@ -40,4 +42,10 @@ public class GroovyScriptTestCase extend
     public void setDispatcher(LocalDispatcher dispatcher) {
         this.dispatcher = dispatcher;
     }
+    public void setSecurity(Security security) {
+        this.security = security;
+    }
+    public Security getSecurity() {
+        return security;
+    }
 }

Modified: 
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java?rev=1823028&r1=1823027&r2=1823028&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/testtools/src/main/java/org/apache/ofbiz/testtools/ModelTestSuite.java
 Sat Feb  3 14:16:16 2018
@@ -202,6 +202,7 @@ public class ModelTestSuite {
         } else if (test instanceof GroovyScriptTestCase) {
             ((GroovyScriptTestCase)test).setDelegator(delegator);
             ((GroovyScriptTestCase)test).setDispatcher(dispatcher);
+            ((GroovyScriptTestCase)test).setSecurity(dispatcher.getSecurity());
         }
     }
 }


Reply via email to