-
Notifications
You must be signed in to change notification settings - Fork 1
/
faq.html
192 lines (192 loc) · 12.7 KB
/
faq.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="date" content="2017-06-14 00:42:52 +0200" />
<link rel="stylesheet" href="book.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>EclEmma - FAQ</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td style="padding:5px 10px 5px 10px;font-size:16pt;font-weight:bold;color:#000066;background-color:#f7f7f7;border:1px solid #a5b6c6;">
EclEmma <span style="color:#8998a5;">3.1.9</span>
</td>
<td style="padding:5px 10px 5px 10px;font-size:16pt;font-weight:bold;color:#8998a5;border-bottom:1px solid #a5b6c6;">
Java Code Coverage for Eclipse
</td>
<td style="padding:0px 0px 0px 0px;border-bottom:1px solid #a5b6c6;text-align:right">
<a href="https://marketplace.eclipse.org/marketplace-client-intro?mpc_install=264" title="Drag to your running Eclipse workspace to install EclEmma Java Code Coverage">
<img src="https://marketplace.eclipse.org/modules/custom/eclipsefdn/eclipsefdn_marketplace/images/btn-install.svg" alt="Drag to your running Eclipse workspace to install EclEmma Java Code Coverage" style="vertical-align:text-bottom; border:0px solid black" />
</a>
</td>
</tr>
<tr><td style="vertical-align:top;padding:20px 10px 20px 10px;background-color:#f7f7f7;border-left:1px solid #a5b6c6;border-right:1px solid #a5b6c6;border-bottom:1px solid #a5b6c6;">
<div class="menu" style="background-image:url(images/topic.gif);margin-left:0px;">
<a href="index.html">Overview</a>
</div>
<div class="menu" style="background-image:url(images/container.gif);margin-left:0px;">
<a href="installation.html">Installation</a>
</div>
<div class="menu" style="background-image:url(images/container.gif);margin-left:0px;">
<a href="userdoc/index.html">User Guide</a>
</div>
<div class="menu" style="background-image:url(images/container.gif);margin-left:0px;">
<a href="support.html">Support</a>
</div>
<div class="menuhi" style="background-image:url(images/topic.gif);margin-left:16px;">
<a href="faq.html">Frequently Asked Questions</a>
</div>
<div class="menu" style="background-image:url(images/topic.gif);margin-left:0px;">
<a href="resources.html">Resources</a>
</div>
<div class="menu" style="background-image:url(images/container.gif);margin-left:0px;">
<a href="devdoc/index.html">Developer Information</a>
</div>
<div class="menu" style="background-image:url(images/container.gif);margin-left:0px;">
<a href="research/index.html">Research</a>
</div>
<div class="menu" style="background-image:url(images/topic.gif);margin-left:0px;">
<a href="jacoco/index.html">JaCoCo</a>
</div>
<div class="menu" style="background-image:url(images/topic.gif);margin-left:0px;">
<a href="changes.html">Change Log</a>
</div>
<div class="menu" style="background-image:url(images/topic.gif);margin-left:0px;">
<a href="license.html">License</a>
</div>
<div class="menu" style="background-image:url(images/topic.gif);margin-left:0px;">
<a href="contact.html">Contact</a>
</div>
<div class="menu" style="margin-top:15pt;background-image:url(images/extern.gif)">
<a href="https://github.com/jacoco">GitHub Home</a>
</div>
<div style="text-align:center;margin-top:0pt;">
<a href="http://www.eclipse.org/org/press-release/20080318_AwardsWinners.php"><img src="images/award.jpg" width="144" height="120" alt="Eclipse Community Award 2008" style="border:0px solid black" /></a>
</div>
<div style="text-align:center;margin-top:10pt;">
<a href="http://www.jacoco.org/jacoco"><img src="images/jacoco.png" height="62" width="140" alt="JaCoCo" style="border:0px solid black" /></a>
</div>
<div style="text-align:center;margin-top:10pt;">
<a href="http://www.sonarqube.org/"><img src="images/sonarqube.png" height="40" width="140" alt="Inspected with sonarqube" style="border:0px solid black" /></a>
</div>
<div style="text-align:center;margin-top:10pt;padding-top:15px;border-top:1px solid #a0a0a0">
<a href="https://www.mtrail.ch/en/career.html"><img src="images/mtrail.png" width="140" height="200" alt="jobs at mtrail" style="border:0px solid black" /></a>
</div>
<div style="text-align:center;margin-top:10pt">
<a href="http://www.javaspecialists.eu/"><img src="images/tjsn.jpg" width="140" height="140" alt="The Java Specialists' Newsletter" style="border:0px solid black" /></a>
</div>
</td><td style="vertical-align:top;padding:0px 0px 5px 20px;width:90%;border-bottom:1px solid #a5b6c6;" colspan="2">
<h1>Frequently Asked Questions</h1><h3>Usage</h3><ul>
<li><a href="#usage01">How can I remove the coverage coloring from the Java editors again?</a></li>
<li><a href="#usage03">How can I run {whateverapplication} with EclEmma?</a></li>
<li><a href="#usage04">Does EclEmma support automated Ant or Maven builds?</a></li>
<li><a href="#usage05">How do I change the source code highlighting?</a></li>
<li><a href="#usage07">Do I need source code to use EclEmma?</a></li>
<li><a href="#usage08">Why is this line yellow?</a></li>
<li><a href="#usage09">How can I exclude test classes from analysis?</a></li>
</ul><h3>Troubleshooting</h3><ul>
<li><a href="#trouble01">Why do I get the error message "No coverage data has been collected during this coverage session"?</a></li>
<li><a href="#trouble02">Code with exceptions shows no coverage. Why?</a></li>
<li><a href="#trouble03">My application does not run with EclEmma!</a></li>
<li><a href="#trouble04">My Eclipse workbench window has no toolbar button for coverage launches!</a></li>
<li><a href="#trouble05">Why are JUnit4 test cases with expected exceptions shown as not covered?</a></li>
<li><a href="#trouble06">The <i>Coverage</i> view stays empty and there is no source highlighting. Why?</a></li>
</ul><h2>Usage</h2><h3><a name="usage01"></a>How can I remove the coverage coloring from the Java editors again?</h3><p>
If you remove the coverage session, also the coverage coloring will disappear.
For this, hit <i>Remove Session</i> or <i>Remove All Sessions</i> in the
<i>Coverage</i> view's toolbar.
</p><h3><a name="usage03"></a>How can I run {whateverapplication} with EclEmma?</h3><p>
EclEmma is designed for Java programs launched within Eclipse. Java
applications that run in a different environment may be directly analyzed with
<a class="extern" href="http://www.jacoco.org/jacoco">JaCoCo</a> using for
example the Ant or Maven integrations. 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.
</p><h3><a name="usage04"></a>Does EclEmma support automated Ant or Maven builds?</h3><p>
EclEmma is a Eclipse integration of the
<a class="extern" href="http://www.jacoco.org/jacoco">JaCoCo</a> code
coverage tool. JaCoCo comes with a set of
<a class="extern" href="http://www.jacoco.org/jacoco/trunk/doc/ant.html">Ant tasks</a>
and <a class="extern" href="http://www.jacoco.org/jacoco/trunk/doc/maven.html">Maven goals</a>
for automated builds.
</p><h3><a name="usage05"></a>How do I change the source code highlighting?</h3><p>
The source code highlighting can be changed in the Eclipse <i>Preference</i>
dialog at <i>General → Appearance → Editors → Text Editors
→ Annotations</i>. You can modify the highlighting style and color or use
the vertical rulers instead.
</p><h3><a name="usage07"></a>Do I need source code to use EclEmma?</h3><p>
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
<i>Coverage</i> tab in the coverage launch dialog. If the library was compiled
with debug information, line coverage will be shown in the
<i>Coverage</i> 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.
</p><h3><a name="usage08"></a>Why is this line yellow?</h3><p>
EclEmma annotates all lines which are partly covered in yellow. Partly covered
means that not all instructions and branches associated with this line have
been executed during the coverage session. In some cases it is not obvious why
the Java compiler creates extra byte code for a particular line of source code.
Such situations might be filtered by future versions of JaCoCo and EclEmma.
</p><h3><a name="usage09"></a>How can I exclude test classes from analysis?</h3><p>
The analysis scope for coverage sessions can be defined in the
<i>Coverage</i> launch dialog on source folder (or library) granularity. As
test code is typically kept in separate source folders or projects this allows
to exclude your test classes from coverage analysis.
</p><h2>Troubleshooting</h2><h3><a name="trouble01"></a>Why do I get the error message "No coverage data has been collected during this coverage session"?</h3><p>
This happens when the Java process did not terminate properly, e.g. has been
manually killed with the <i>Terminate</i> button. Make sure your Java program
terminates on its own. Alternatively you can dump coverage data for the
running process before you terminate it. For this select the button <i>Dump
Execution Data</i> from the <i>Coverage</i> view's toolbar.
</p><p>
</p><h3><a name="trouble02"></a>Source code lines with exceptions show no coverage. Why?</h3><p>
The underlying JaCoCo code coverage library determines code execution with so
called probes. Probes are inserted into the control flow at certain positions.
Code is considered as executed when a subsequent probe has been executed. In
case of exceptions such a sequence of instructions is aborted somewhere in the
middle and the corresponding line of source code is not marked as covered.
</p><h3><a name="trouble03"></a>My application does not run with EclEmma!</h3><p>
Does your application properly execute within Eclipse in normal <i>run</i>
mode? Please verify! If not, your app will most likely not execute in
<i>coverage</i> mode either. In this case first create a proper launch
configuration in Eclipse; then execute in <i>coverage</i> mode.
</p><h3><a name="trouble04">My Eclipse workbench window has no toolbar button for coverage launches!</a></h3><p>
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 <i>Resource</i> select
<i>Customize Perspective...</i> from the toolbar's context menu and check the
<i>Java Code Coverage</i> option on the <i>Command Groups Availability</i> tab.
</p><h3><a name="trouble05">Why are JUnit4 test cases with expected exceptions shown as not covered?</a></h3><p>
JUnit4 test cases with expected exceptions are shown as not covered even
though they were executed. The reason for this is that underlying JaCoCo code
coverage library only considers code as executed when certain probes are
executed. For successful test cases marked with <code>@Test{expected=...}</code>
this is not the case. See also <a href="#trouble02">"Source code lines with
exceptions show no coverage. Why?"</a>.
</p><h3><a name="trouble06">The <i>Coverage</i> view stays empty and there is no source highlighting. Why?</a></h3><p>
In Eclipse preferences there is an option <i>Launch in debug mode when
workspace contains breakpoints</i> under <i>Run/Debug</i> →
<i>Launching</i>. If this option is enabled and there are breakpoints in your
workspace <i>coverage</i> mode will not work, because it is automatically
replaced with <i>debug</i> mode. Set this option to <i>Never</i> if you want
to run code coverage analysis.
</p>
</td></tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
<tr>
<td class="footer"><a href="license.html">Copyright</a> © 2006, 2017 Mountainminds GmbH & Co. KG and Contributors</td>
<td class="footer" style="text-align:right;">
Validate
<a href="http://validator.w3.org/check?uri=http://www.eclemma.org/faq.html">XHTML</a>/<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.eclemma.org/faq.html">CSS</a> ·
Last Modified
<a href="https://github.com/jacoco/eclemma/blob/6bec4798151989ffe935c6c9a65f4bbbb6aeec5f/org.eclipse.eclemma.doc/pages/faq.html">2017-06-14</a> in Commit
<a href="https://github.com/jacoco/eclemma/commit/6bec4798151989ffe935c6c9a65f4bbbb6aeec5f">6bec4798</a>
</td>
</tr>
</table>
</body>
</html>