db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Li" <liyilei1...@gmail.com>
Subject Re: [test] Junit test fail and throw AccessControlException
Date Mon, 09 Jul 2007 08:48:32 GMT
On 7/9/07, Sean Qiu <sean.xx.qiu@gmail.com> wrote:
> How to run test without install an SecurityManager?  "ant junit-core
> -Djava.security.policy=<NONE>"  ?
> But it seems not  work.
>
I guess the security manager is installed by derby itself or its test.

> 2007/7/9, Sean Qiu <sean.xx.qiu@gmail.com>:
> >
> > Hi,guys
> >
> > I build the derby source code successfully, and then run the junit test
> with "ant juni-core", but It will fail and throw AccessControlException[1].
> >
> > SecurityManagerSetup will install a SecurityManager with policy file of
> org/apache/derbyTesting/functionTests/util/derby_tests.policy.
> > Won't this policy file grant the code propor permission? or am i missing
> some thing?
> >
> >
> > [1] Test failure message
> >     [junit] Running
> org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadTest
> >     [junit] Exception in thread "main"
> java.security.AccessControlException: Access denied
> (java.io.FilePermission D:\at\derby\jun
> > itvmwatcher954993545.properties write)
> >     [junit]     at
> java.security.AccessController46checkPermission(AccessController.java:103)
> >     [junit]     at
> java.lang.SecurityManager46checkPermission(SecurityManager.java
> :532)
> >     [junit]     at
> java.lang.SecurityManager46checkWrite(SecurityManager.java:962)
> >     [junit]     at
> java.io.FileOutputStream46<init>(FileOutputStream.java:169)
> >     [junit]     at java.io.FileOutputStream46
> <init>(FileOutputStream.java:70)
> >     [junit]     at java.io.FileWriter46<init>(FileWriter.java:46)
> >     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner46registerTestCase(JUnitTestRunner.java
> :940)
> >     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner46access$000(JUnitTestRunner.java:68)
> >     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner$346startTest
> (JUnitTestRunner.java:807)
> >     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner$446startTest(JUnitTestRunner.java:1005)
> >
> > Thanks.
> > --
> > Sean Qiu
>
>
>
> --
> Sean Qiu


-- 
Leo Li
China Software Development Lab, IBM

Mime
View raw message