db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4950) AccessControlException when running AssertFailureTest from Ant
Date Thu, 23 Dec 2010 09:19:01 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-4950:
--------------------------------------

    Attachment: d4950.diff

The problem seems to be that AssertFailureTest installs its own security policy, but this
policy doesn't grant any privileges to junit.jar. The attached patch copies the following
from derby_test.policy into the custom policy files for AssertFailureTest:

grant codeBase "${derbyTesting.junit}" {
    // This permission is needed when running the tests using ant 1.7
    permission java.io.FilePermission "${user.dir}${/}*", "write";
};

This allows Ant's JUnit runner to write to junitvmwatcherXYZ.properties, and the test runs
cleanly again.

> AccessControlException when running AssertFailureTest from Ant
> --------------------------------------------------------------
>
>                 Key: DERBY-4950
>                 URL: https://issues.apache.org/jira/browse/DERBY-4950
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d4950.diff
>
>
> Seen when running "ant junit-all":
>     [junit] Running org.apache.derbyTesting.unitTests.junit._Suite
>     [junit] Exception in thread "main" java.security.AccessControlException: access denied
(java.io.FilePermission /code/derby/trunk0/junit_20101222_2349/junitvmwatcher3394322945027170783.properties
write)
>     [junit]     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
>     [junit]     at java.security.AccessController.checkPermission(AccessController.java:546)
>     [junit]     at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
>     [junit]     at java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
>     [junit]     at java.io.FileOutputStream.<init>(FileOutputStream.java:169)
>     [junit]     at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
>     [junit]     at java.io.FileWriter.<init>(FileWriter.java:46)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.registerTestCase(JUnitTestRunner.java:939)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.access$000(JUnitTestRunner.java:68)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner$2.startTest(JUnitTestRunner.java:808)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner$3.startTest(JUnitTestRunner.java:1004)
>     [junit]     at junit.framework.TestResult.startTest(TestResult.java:151)
>     [junit]     at junit.framework.TestResult.run(TestResult.java:103)
>     [junit]     at junit.framework.TestCase.run(TestCase.java:120)
>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:230)
>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:225)
>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:230)
>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:225)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
>     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
>     [junit] Running org.apache.derbyTesting.unitTests.junit._Suite
>     [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
>     [junit] Test org.apache.derbyTesting.unitTests.junit._Suite FAILED (crashed)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message