Emma and Netbeans


It's possible to get Emma coverage of your Netbeans web app.

Here's my brief notes:

Put emma.jar in lib folder of the NetBeans project.

Modify project.properties

  1. Insert a new file reference:
    file.reference.emma.jar=lib/emma.jar
  2. Add to  javac.classpath property
        ${file.reference.emma.jar}


Compile the source files.

At the command line, do the emma instrumentation step:

Change directory to the build subfolder containing the class files.
java -cp pathtolibfolder/emma.jar:. emma instr -ip . -m overwrite

Run unit tests -- "Test Project".   Don't recompile/rebuild the project.

At the command line, run the emma reporting step.

Change directory to the build subfolder containing the class files.

java -cp pathtolibfolder/emma.jar emma report -r html  -sp .
           -in coverage.em   -in pathtoproject/coverage.ec 


The output is in the coverage folder.

Ultimately, emma can be included as an Ant task in the NetBeans build script.
That would eliminate the need for the manual command steps.


Whiteboard photo of diagram for using Emma to get coverage of JSP's.