db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r676104 - in /db/jdo/trunk/tck2: maven.xml src/conf/security.policy
Date Sat, 12 Jul 2008 00:07:15 GMT
Author: clr
Date: Fri Jul 11 17:07:15 2008
New Revision: 676104

URL: http://svn.apache.org/viewvc?rev=676104&view=rev
Log:
JDO-555 Add security manager option to maven tck runs

Added:
    db/jdo/trunk/tck2/src/conf/security.policy
Modified:
    db/jdo/trunk/tck2/maven.xml

Modified: db/jdo/trunk/tck2/maven.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/maven.xml?rev=676104&r1=676103&r2=676104&view=diff
==============================================================================
--- db/jdo/trunk/tck2/maven.xml (original)
+++ db/jdo/trunk/tck2/maven.xml Fri Jul 11 17:07:15 2008
@@ -124,6 +124,12 @@
         <j:set var="true" value="true"/>
         <j:set var="false" value="false"/>
 
+        <j:if test="${jdo.tck.security}">
+            <j:set var="jdo.tck.security.jvmargs" 
+                value="-Djava.security.manager -Djava.security.policy=${basedir}/src/conf/security.policy"/>
+        <echo message="Running with Java security manager settings: ${jdo.tck.security.jvmargs}"/>
+        </j:if>
+
         <j:set var="cfglist" value="${jdo.tck.cfglist}"/>
         <j:if test="${cfglist == null}">
             <u:properties file="${basedir}/src/conf/configurations.list"/>
@@ -248,6 +254,9 @@
               <arg value="${basedir}/src/sql/${jdo.tck.database}/${jdo.tck.identitytype}/${jdo.tck.schema}"/>
               <sysproperty key="derby.system.home"
                       value="${jdo.tck.testdir}/database/${jdo.tck.database}"/>
+              <sysproperty key="jdo.tck.basedir"
+                      value="${jdo.tck.basedir}"/>
+              <jvmarg line="${jdo.tck.security.jvmargs}"/>
         </java>
     </goal>
 
@@ -488,10 +497,21 @@
                          value="${jdo.tck.closePMFAfterEachTest}"/>
             <sysproperty key="jdo.tck.signaturefile"
                          value="${jdo.tck.signaturefile}"/>
+            <sysproperty key="jdo.tck.junit.jarfile"
+                         value="${junit.jarfile}"/>
+            <sysproperty key="jdo.tck.testclasses.dir"
+                         value="${jdo.tck.testclasses.dir}"/>
+            <sysproperty key="jdo.api.jarfile"
+                         value="${jdo.api.jarfile}"/>
+            <sysproperty key="jdo.tck.basedir"
+                         value="${jdo.tck.basedir}"/>
+            <sysproperty key="jdo.tck.jdori.jarfile"
+                         value="${datanucleus.jdori.jarfile}"/>
                          
             <jvmarg line="${database.runtck.sysproperties}"/>
             <jvmarg line="${jdori.runtck.sysproperties}"/>
             <jvmarg line="${jdo.tck.debug.jvmargs}"/>
+            <jvmarg line="${jdo.tck.security.jvmargs}"/>
             
             <arg line="${jdo.tck.classes}"/>
         </java>

Added: db/jdo/trunk/tck2/src/conf/security.policy
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/security.policy?rev=676104&view=auto
==============================================================================
--- db/jdo/trunk/tck2/src/conf/security.policy (added)
+++ db/jdo/trunk/tck2/src/conf/security.policy Fri Jul 11 17:07:15 2008
@@ -0,0 +1,36 @@
+// JUnit code base
+grant codeBase "file://${jdo.tck.junit.jarfile}" {
+    permission java.io.FilePermission "${user.home}/junit.properties", "read";
+};
+
+// TCK test classes
+grant codeBase "file://${jdo.tck.testclasses.dir}/-" {
+    permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory";
+    permission javax.jdo.spi.JDOPermission "setStateManager";
+};
+
+// JDO API code base
+grant codeBase "file://${jdo.api.jarfile}" {
+    permission javax.jdo.spi.JDOPermission "getMetadata";
+    permission javax.jdo.spi.JDOPermission "setStateManager";
+};
+
+// JDO RI code base
+grant codeBase "file://${jdo.tck.jdori.jarfile}" {
+    permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory";
+    permission javax.jdo.spi.JDOPermission "getMetadata";
+    permission javax.jdo.spi.JDOPermission "setStateManager";
+};
+
+// All classes in the classpath
+grant {
+// c3p0 seems to require PropertyPermission of write (don't know why)
+    permission java.util.PropertyPermission "*", "read, write";
+    permission java.io.FilePermission "${user.home}/.maven/repository/-", "read";
+    permission java.io.FilePermission "${jdo.tck.basedir}/target/-", "read, write";
+// bug in security? needed for Derby to create tck2/target/database/derby/../../logs
+    permission java.io.FilePermission "${jdo.tck.basedir}/-", "read, write, delete";
+// needed for JNDI FSContext
+    permission java.io.FilePermission "/", "read";
+    permission java.lang.RuntimePermission "createClassLoader";
+};



Mime
View raw message