Frequently Asked Questions

Usage

Troubleshooting

Installation

Usage

How can I remove the coverage coloring from the Java editors again?

If you remove the coverage session, also the coverage coloring will disappear. For this, hit Remove Session or Remove All Sessions in the Coverage view's toolbar.

Why can't I select source folders separately for instrumentation?

EMMA works on Java class files. If source folders have the same output location, only all or none of them can be selected for instrumentation. If you want to select them individually please specify a different output location for each source folder. This can be done in the Java Build Path settings in the project properties. Check Allow output folders on the Source tab and specify different output folders for your source folders (for example bin-src/, bin-test/ etc.).

How can I run {whateverapplication} with EclEmma?

EclEmma is designed for Java programs launched within Eclipse. Java applications that run in a different environment may be analyzed with the EMMA library directly. There are different supported launch types, other plug-ins may define additional launch types which are not supported by EclEmma. Check user documentation for currently supported launch types.

Does EclEmma support automated Ant builds?

EclEmma is a Eclipse integration of the EMMA code coverage tool. EMMA itself comes with a comprehensive set of Ant tasks and can be used in automated builds. See EMMA documentation for details.

How do I change the source code highlighting?

The source code highlighting can be changed in the Eclipse Preference dialog at General → Appearance → Editors → Text Editors → Annotations. You can modify the highlighting style and color or use the vertical rulers instead.

Why can't I uncheck in-place instrumentation in the launch dialog?

Some launch types require in-place instrumentation as there is no other way to get the instrumented classes into the classpath. In this case the checkbox is disabled and can not be unchecked.

Do I need source code to use EclEmma?

No, you can also get coverage information for e.g. third-party JARs. Just make them part of your class path settings in Eclipse and select them on the Coverage tab in the coverage launch dialog. If the library was compiled with debug information, line coverage will be shown in the Coverage view. In case the source is properly attached to the library syntax highlighting will happen in the editors the same way as with you source code.

Why is this line yellow?

EclEmma annotates all lines which are partly covered in yellow. Partly covered means that not all of the basic blocks associated with this line have been executed during the coverage session. In some cases it is not obvious why the Java compiler creates multiple blocks for a particular line of source code. Please see EMMA's FAQ entry about partially covered lines for details.

Troubleshooting

I get the error message "No coverage data file has been written". Please help!

This may have several reasons:

Code with exceptions shows no coverage. Why?

The underlying EMMA library works on so called basic blocks. A basic block is a sequence of instructions without any jumps or jump targets. A basic block is marked as executed when it reaches its last instruction. In case of exceptions a basic block is aborted somewhere in the middle and not marked as executed. See EMMA's FAQ for details.

My application does not run with EclEmma!

Does your application properly execute within Eclipse in normal run mode? Please verify! If not, your app will most likely not execute in coverage mode either. In this case first create a proper launch configuration in Eclipse; then execute in coverage mode.

My Eclipse workbench window has no toolbar button for coverage launches!

Even if EclEmma is installed properly, it will show its action sets only in some predefined perspectives related to Java tasks. If you want to use the coverage toolbar in other perspectives like Resource select Customize Perspective... from the toolbar's context menu and check the Coverage option on the Commands tab.

Installation

Does EclEmma work with IBM Rational products?

Yes, it has been confirmed that EclEmma works with RAD 7.0. The IBM Rational 6.0 products will not work with EclEmma, as they are based on Eclipse 3.0, EclEmma requires at least Eclipse 3.1.