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

Vemund Østgaard updated DERBY-3445:
-----------------------------------

    Attachment: 3445-testspecific-diff
                3445-general-diff

I've made a patch that I think makes it a lot easier to run codecoverage 
measurements with the junit suites using EMMA and ant 1.7. Just download 
emma.jar and emma_ant.jar and place them under tools/java/ and everything 
should work, at least with ant 1.7.

I have put the general changes in a patchfile named 3445-general-diff. The 
changes in this patch are:
- A lot of new permissions in derby_tests.policy, both for EMMA writing to its 
coverage.ec file, and for running junit from ant with ant version 1.7 which 
writes to some temporary files.
- SecurityManagerSetup now sets a new property "derbyTesting.emma" to the 
location of emma.jar. This is used in the policy files to grant permissions to 
emma.jar, without having to know where it will be placed by the person running 
the test.
- Several new tasks are added to build.xml for running tests with EMMA. The 
most important one is emma-report, which instruments your jar-files and places 
the instrumented copies under jars/emma/, and then runs the junit task 
<junit-all> before it creates three sets of coverage reports (txt, xml and 
html) linked to the derby source files. I've adapted the old <junit-all> task 
to work with EMMA and ant 1.7.
- Added properties for emma.jar and emma_ant.jar in 
tools/ant/extrapath.properties. If you 

I have made some test-specific changes as well, and put them in a separate 
pathfile named 3445-testspecific-diff. These changes are:
- Extra permissions in SecurityPolicyReloadingTest.initial.policy, 
NetworkServerControlApiTest.policy and ServerPropertiesTest.policy to get these 
tests to run with EMMA and ant 1.7.
- Added emma.jar to classpath for classloader used in SysinfoLocaleTest.java.
- Added property emma.verbosity.level=silent to commandline used in 
SecureServerTest.java.


This is a first step to make it easier to run with EMMA. Going forward, it 
might be useful to improve the emma-tasks in build.xml to be able to run 
codecoverage experiments with the classes in addition to the jars and to 
integrate with the other junit-tasks as well.

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

Reply via email to