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.
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.).
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.
EclEmma is a Eclipse integration of the EMMA code coverage tool. EMMA itself comes with a set of Ant tasks for automated builds. If your test target is a Eclips/OSGi application (e.g. JUnit plug-in tests) the EclEmma Equinox Runtime easily adds code coverage.
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.
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.
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.
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.
This may have several reasons:
emma.jar
file in your JDK's lib/ext/
folder. Please remove this and restart Eclipse.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.
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.
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.
JUnit4 test cases with expected exceptions are shown as not covered even though
they were executed. The reason for this is that underlying coverage library EMMA
only considers block as executed when they reach their last instruction. For
successful test cases marked with @Test{expected=...}
this is not
the case. See also "Code with exceptions shows no coverage. Why?".
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.