[ 
http://issues.apache.org/jira/browse/DERBY-892?page=comments#action_12365438 ] 

Daniel John Debrunner commented on DERBY-892:
---------------------------------------------

My concern with multiple complete files is keeping them all up to date, too 
easy for only one file to be modified.

There are several examples in the derbyTests.policy file where a policy is 
granted for a single test, e.g..

  // sane=true, jdbcapi/secureUsers1.sql
  permission java.io.FilePermission "${user.dir}${/}CloudLDAP.out", "write"; 

  // unit tests (e.g. store/T_RecoverFullLog) set this property 
  // (called from derbyTesting.jar through code in derby.jar)
  permission java.util.PropertyPermission "derbyTesting.unittest.*", "write";

I think, though I haven't tried it, that adding permissions into a policy file 
is as simple as adding two files together.
If the system allows multiple grant blocks to a single codebase then additional 
files would look like this and could
be just appended by the harness to the base policy file.

grant codeBase "${derbyTesting.codejar}derby.jar" {
// sane=true, jdbcapi/secureUsers1.sql
  permission java.io.FilePermission "${user.dir}${/}CloudLDAP.out", "write"; 
}




> add mechanism for specifying policy file for individual function tests
> ----------------------------------------------------------------------
>
>          Key: DERBY-892
>          URL: http://issues.apache.org/jira/browse/DERBY-892
>      Project: Derby
>         Type: Bug
>     Versions: 10.2.0.0
>     Reporter: Myrna van Lunteren
>     Priority: Minor

>
> It would be nice to be able to specify a test-specific policy file.
> This should get handled similar to existing properties, i.e. get specified in 
> a test_app.properties file (or, for a suite, in the suite.properties file).  
> The file should then be copied into the correct place.
> Note, that the 'old' functionTests harness (as opposed to junit tests) 
> includes a check for a property called 'serverPolicyFile' (in 
> harness/jvm.java). The name is a left over from when the policy file was only 
> used for/by network server, and should be renamed - derbyTestPolicyFile, for 
> instance. It is not used anywhere at present, and not specific to network 
> server. It would be nice if this could be expanded, or, if not used, removed.
> The default policy file used is the derby_tests.policy file under 
> functionTests/util.
> Also, currently, the property can only be used with RunTest - for further 
> traction, it should probably get passed on through RunSuite/RunList.
> Once confirmed to be working, the property should get documented in 
> <trunk>/java/testing/README.htm.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to