db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1616111 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/util/derby_tests.policy junit/SecurityManagerSetup.java
Date Wed, 06 Aug 2014 06:52:21 GMT
Author: kahatlen
Date: Wed Aug  6 06:52:21 2014
New Revision: 1616111

URL: http://svn.apache.org/r1616111
Log:
DERBY-6685: Permission problems when running JUnit tests with Ant 1.9.4

Grant write permission to ant.jar so that test results can be written
to a file.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?rev=1616111&r1=1616110&r2=1616111&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
Wed Aug  6 06:52:21 2014
@@ -413,6 +413,13 @@ grant codeBase "${derbyTesting.antjunit}
     permission java.io.FilePermission "${user.dir}${/}*", "write";
 };
 
+// Starting with Ant 1.9.3, write permission has to be granted to ant.jar
+// as well so that Ant's JUnit runner can write test results to a file.
+// Only needed when running the tests under Ant. See DERBY-6685.
+grant codeBase "${derbyTesting.ant}" {
+    permission java.io.FilePermission "${user.dir}${/}*", "write";
+};
+
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
 // to check to see if permissions are granted through generated code
 // through this mechanism.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java?rev=1616111&r1=1616110&r2=1616111&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
Wed Aug  6 06:52:21 2014
@@ -353,6 +353,11 @@ public final class SecurityManagerSetup 
         if (antjunit != null)
             classPathSet.setProperty("derbyTesting.antjunit", antjunit.toExternalForm());
 
+        URL ant = getURL("org.apache.tools.ant.Task");
+        if (ant != null) {
+            classPathSet.setProperty("derbyTesting.ant", ant.toExternalForm());
+        }
+
         // variables for lucene jar files
         URL luceneCore = getURL( "org.apache.lucene.store.FSDirectory" );
         if ( luceneCore != null )



Mime
View raw message