How to instrument IDE for manual testing
Ant and JDK must be installed on your system before you can run coverage tests.
Before starting be sure you have xtest module checked out and folder
xtest/external contains emma.jar and emma_ant.jar, those files can be downloaded
from EMMA download site
(last 2.0.x version of EMMA).
Or you can use script that downloads emma libraries for you, in that case you
need to provide proxy settings on command line when executing Ant script:
-Dproxy.host=[proxy_host] -Dproxy.port=[proxy_port]
User defined properties
There are couple of properties that are needed to be correctly set in
build.xml file before you can instrument IDE. Those properties are:
jdkhome
- Location of JDK that will be used to run instrumented IDE
netbeans.dir
- NetBeans installation dir, IDE on this location will be copied
over and instrumented (default value: nbbuild/netbeans)
included.packages
- List of packages that will be instrumented
(default value: org.netbeans.*, org.openide.*, org.openidex.*,
javax.jmi.*, org.apache.tools.ant.module.*)
coverage.runtime.file
- Name of the file for writing EMMA runtime coverage data for given session
(default value: coverage.ec)
Important notes
When performing tests on instrumented IDE:
- Do not run more instances of NetBeans with the same .ec file (file will be corrupted)
- When doing extensive long tests make sure you log each session into separate .ec file
Use following system property to extend available memory for Ant process
ANT_OPTS=Xmx512m
when generating report,
otherwise OutOfMemoryError will be thrown.
Targets
List of main Ant targets:
instrument-ide
- Executes all necessary subtargets and creates instrumented IDE
run-ide
- Runs instrumented IDE
clean-ide
- Deletes instrumented IDE, with userdir
clean-emma
- Deletes EMMA data files
clean-report
- Deletes EMMA report
clean-userdir
- Deletes IDE uderdir
real-clean
- Runs all clean targets above
emma-report
- Creates report from all available EMMA data files