db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Regarding DERBY-1272
Date Mon, 22 Oct 2007 16:19:34 GMT
Hi Ramin,

The problem may be that your test is not reading derby.system.home from 
inside a privileged block. If your test extends BaseTestCase, then you 
can call getSystemProperty() to read derby.system.home and that method 
will set up the privileged block needed to read the property.

Hope this helps,
-Rick

Ramin Moazeni wrote:
> Hello
>
> In writing test for DERBY-1272, I receive the following exception
> 1)testDerbyLog(org.apache.derbyTesting.functionTests.tests.lang.DerbyLogTest)java.security.AccessControlException:
> access denied (java.util.PropertyPermission derby.system.home read)
>
> and the reason is because I am trying to get the derby.system.home property:
>  String derbyHome = System.getProperty("derby.system.home");
>
> The only way I was able to get around this was to disable the security manager
> as follows:
> java -Djava.security.policy="<NONE>" junit.textui.TestRunner
> org.apache.derbyTesting.functionTests.tests.lang.DerbyLogTest
>
> Is is this the right approach? Is this documented anywhere or is this a bug?
>
> Thanks
> Ramin
>
> PS. I tried adding
> permission java.util.PropertyPermission "derby.system.home", "read";
> to
> util/derby_tests.policy whcih didn't resolve my problem.
>   


Mime
View raw message