db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramandeep Kaur" <ramandhin...@gmail.com>
Subject code coverage: problem in running junit suite lang with emma
Date Wed, 07 Feb 2007 23:32:58 GMT
Hi All,

I ran code coverage for junit suites - derbynet, lang, jdbcapi, store,
tools.

First of all emma does not work with default derby_tests.policy in
derbyTesting.jar file as emma gives an exception while creating code
coverage file " coverage.ec". So before running code coverage, I edit
derby_tests.policy file to include line "permission
java.security.AllPermission;" in it so that coverage.ec file can get
created.

Now, with the above change in derby_tests.policy, junit suites - derbynet,
jdbcapi, store, and tools run fine, but junit suite - lang does not finish.
After running few tests, it exits out.

The output looks like the following:

>java -Djvmflags=-Demma.verbosity.level=silent -Dverbose=true
junit.textui.TestRunner
org.apache.derbyTesting.functionTests.tests.lang._Suite

EMMA: collecting runtime coverage data
.........................................
.........................................
........................................F.


As adding line "permission java.security.AllPermission;" to
derby_tests.policy makes lang suite to run incompletely, I added line
"permission java.io.FilePermission "${user.home}${/}coverage.ec", "write";"
to derby_tests.policy instead of line "permission
java.security.AllPermission;" and ran tests as following

>java -Demma.coverage.out.file="$HOME/coverage.ec" -Djvmflags=-
Demma.verbosity.level=silent -Dverbose=true junit.textui.TestRunner
org.apache.derbyTesting.functionTests.tests.lang._Suite

The output looked like the following:
EMMA: collecting runtime coverage data ...
.........................................
.........................................
.........................................
.........................................
.........................................
.........................................
.........................................
.........................................
.........................................
.........................................
..............
Time: 909.446

OK (424 tests)

java.security.AccessControlException: access denied
(java.io.FilePermissionC:\Documents and Settings\raman\coverage.ec
read)
 at java.security.AccessControlContext.checkPermission(
AccessControlContext.java:323)
 at java.security.AccessController.checkPermission(AccessController.java
:546)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
 at java.io.File.exists(File.java:731)
 at com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
 at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
 at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(
RTCoverageDataPersister.java:54)
 at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
 at java.lang.Thread.run(Thread.java:619)
Exception in thread "EMMA shutdown handler thread"
java.lang.RuntimeException: EMMA failed to dump coverage data:
java.security.AccessControlException: access denied
(java.io.FilePermissionC:\Documents and Settings\raman\coverage.ec
read)
 at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(
RTCoverageDataPersister.java:71)
 at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
 at java.lang.Thread.run(Thread.java:619)


I am not sure why exception java.security.AccessControlException gets thrown
even though I have "permission java.io.FilePermission
"${user.home}${/}coverage.ec",
"write";" in derby_tests.policy file.

-- 
Ramandeep Kaur
ramandhindsa@gmail.com

Mime
View raw message