db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3445) Make it easier to use the EMMA tool to measure the code coverage of the Derby testing
Date Mon, 25 Feb 2008 17:44:51 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572140#action_12572140
] 

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

It's a concern that permissions are always granted to derby.jar, even though they are only
needed if performing code coverage with EMMA.
This creates an opportunity where Derby code could unknowingly start to depend on those permissions.

These permissions are as follows, are they needed for all code in the stack, or just a subset?

+    // These permissions are needed when testing code instrumented with EMMA.
+    permission java.util.PropertyPermission "user.dir", "read";
+    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read";
+    permission java.lang.RuntimePermission "writeFileDescriptor";

A work-around may be to add separate sections in the policy file, e.g. if these permissions
are only needed for a subset of jars then:

 grant codebase "${emmaActive}/derby.jar" {
   permission java.util.PropertyPermission "user.dir", "read";
   permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read";
   permission java.lang.RuntimePermission "writeFileDescriptor";
};

then emmaActive is only set when running code coverage with EMMA. It possible a similar trick
could be done if they are needed for all code,
something that resolves to:
 grant  {
   permission java.util.PropertyPermission "user.dir", "read";
   permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read";
   permission java.lang.RuntimePermission "writeFileDescriptor";
};

if and only if some emma property is set.

> Make it easier to use the EMMA tool to measure the code coverage of the Derby testing
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-3445
>                 URL: https://issues.apache.org/jira/browse/DERBY-3445
>             Project: Derby
>          Issue Type: Improvement
>          Components: Build tools
>            Reporter: Vemund Østgaard
>            Assignee: Vemund Østgaard
>         Attachments: 3445-general-diff, 3445-testspecific-diff
>
>
> It is a bit tricky to use EMMA to measure code coverage for the derby testing.
> Modifications must be made to the source both to avoid problems with the SecurityManager
and individual tests. It would be good if these modifcations could be done once and for all
so that it was easier for anyone to run the tests with EMMA.
> It would also be good to have ant tasks that would make it even easier to run the tests
with EMMA.

-- 
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