~ubuntu-branches/ubuntu/jaunty/ant/jaunty-proposed

« back to all changes in this revision

Viewing changes to docs/manual/OptionalTasks/jpcoverage.html

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Gybas
  • Date: 2002-02-14 14:28:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020214142848-2ww7ynmqkj31vlmn
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
</head>
 
4
<body>
 
5
 
 
6
<h1><a name="jprobe">JProbe</a></h1>
 
7
<p>by</p>
 
8
<ul>
 
9
    <li>Stephane Bailliez (<a href="mailto:sbailliez@imediation.com">sbailliez@imediation.com</a>)</li>
 
10
</ul>
 
11
<h2>Introduction</h2>
 
12
 
 
13
<p>This task runs the tools from the JProbe suite.<br>
 
14
For more information, visit <a href="http://www.sitraka.com">http://www.sitraka.com</a>.
 
15
An evaluation version is available for download if you already don't own it.
 
16
</p>
 
17
 
 
18
<p>This task has been written using JProbe Suite Server Side 3.0.</p>
 
19
 
 
20
<p>It is highly recommended to read the JProbe documentation to understand
 
21
the values of the command line arguments described below. This
 
22
document is less complete than the manual, it only gives the basic information
 
23
and is not intended as a replacement to the manual.
 
24
</p>
 
25
 
 
26
<h2>Tasks</h2>
 
27
<ul>
 
28
<table border="0" cellspacing="0" cellpadding="3">
 
29
    <tr>
 
30
        <td><a href="#jpcoverage">JPCoverage</a></td>
 
31
        <td>Measure coverage of Java code.</td>
 
32
    </tr>
 
33
    <tr>
 
34
        <td><a href="#jpcovmerge">JPCovMerge</a></td>
 
35
        <td>Merge different snapshots into one.</td>
 
36
    </tr>
 
37
    <tr>
 
38
        <td><a href="#jpcovreport">JPCovReport</a></td>
 
39
        <td>Create a report from a snapshot</td>
 
40
    </tr>
 
41
</table>
 
42
</ul>
 
43
 
 
44
<hr>
 
45
 
 
46
<h2><a name="jpcoverage">JPCoverage</a></h2>
 
47
Perform code covering functions by comparing source code line execution to the programļæ½s source code as a whole.
 
48
 
 
49
<h3>Parameters</h3>
 
50
<table border="1" cellpadding="2" cellspacing="0">
 
51
<tr>
 
52
  <td width="12%" valign="top"><b>Attribute</b></td>
 
53
  <td width="78%" valign="top"><b>Description</b></td>
 
54
  <td width="10%" valign="top"><b>Required</b></td>
 
55
</tr>
 
56
  <tr>
 
57
    <td valign="top">home</td> 
 
58
    <td valign="top">The directory where is intalled JProbe.</td>
 
59
    <td align="center" valign="top">Yes</td>
 
60
  </tr>
 
61
  <tr>
 
62
    <td valign="top">vm</td> 
 
63
    <td valign="top">
 
64
        Indicates which virtual machine to run.
 
65
        Must be one of "jdk117", "jdk118" or "java2".If "java2" is specified, the user is
 
66
        also required to specify a path via <tt>javahome</tt>, otherwise it will check if
 
67
        the current executing VM is 1.2+ and use its java.home property to determine its
 
68
        location.
 
69
        in the registry for the default 1.2.x (Java 2) VM.</td>
 
70
    <td align="center" valign="top">No, default to embedded VM if 1.2+</td>
 
71
  </tr>
 
72
  <tr>
 
73
    <td valign="top">javahome</td> 
 
74
    <td valign="top">For Java 2 only, specifies the path of the jdk1.2.x virtual
 
75
        machine to be used. This is only valid when specifying the <tt>vm="java2"</tt>.</td>
 
76
    <td align="center" valign="top">No, use only for java2</td>
 
77
  </tr>
 
78
  <tr>
 
79
    <td valign="top">javaexe</td> 
 
80
    <td valign="top">Similar to <tt>javahome</tt>, except this is the path to
 
81
        the java executable.</td>
 
82
    <td align="center" valign="top">No, use only for java2</td>
 
83
  </tr>
 
84
  
 
85
  <tr>
 
86
    <td valign="top">applet</td> 
 
87
    <td valign="top">Run an applet. The default is false, unless the file under
 
88
        analysis ends with htm or html.</td>
 
89
    <td align="center" valign="top">No, default is "false".</td>
 
90
  </tr>
 
91
  <tr>
 
92
    <td valign="top">seedname</td>
 
93
    <td valign="top">Seed name for the temporary snapshot files (files will be named
 
94
        seed.jpc, seed1.jpc, seed2.jpc, ...)</td>
 
95
    <td align="center" valign="top">No, default to &quot;snapshot&quot;</td>
 
96
  </tr>
 
97
  
 
98
  <tr>
 
99
    <td valign="top">exitprompt</td> 
 
100
    <td valign="top">Toggles display of the console prompt: "Press Enter to close
 
101
        this window." &quot;always&quot;: Always displays the prompt. &quot;never&quot;: Never displays the
 
102
        prompt. &quot;error&quot;: Only displays prompt after an error.</td>
 
103
    <td align="center" valign="top">No, default is "never"</td>
 
104
  </tr>
 
105
  
 
106
  <tr>
 
107
    <td valign="top">finalsnapshot</td> 
 
108
    <td valign="top">Type of snapshot to send at program termination. Must be one
 
109
        of &quot;none&quot;,&quot;coverage&quot;,&quot;all&quot;</td> 
 
110
    <td align="center" valign="top">No, default to &quot;coverage&quot;</td>
 
111
  </tr>
 
112
  <tr>
 
113
    <td valign="top">recordfromstart</td>
 
114
    <td valign="top">Must be one of "coverage", "all", "none". If you want
 
115
        Coverage to start analyzing as soon as the program begins to run, use "all".
 
116
        If not, select "none".</td>
 
117
    <td align="center" valign="top">No, default to "coverage"</td>
 
118
  </tr>
 
119
  <tr>
 
120
    <td valign="top">warnlevel</td>
 
121
    <td valign="top">Set warning level (0-3, where 0 is the least amount of warnings).</td>
 
122
    <td align="center" valign="top">No, default to 0</td>
 
123
  </tr>
 
124
  <tr>
 
125
    <td valign="top">snapshotdir</td>
 
126
    <td valign="top">The path to the directory where snapshot files are stored.
 
127
        Choose a directory that is reachable by both the remote and local computers,
 
128
        and enter the same path on the command line and in the viewer.</td>
 
129
    <td align="center" valign="top">No, default to current directory</td>
 
130
  </tr>
 
131
  <tr>
 
132
    <td valign="top">workingdir</td>
 
133
    <td valign="top">The physical path to the working directory for the VM.</td>
 
134
    <td align="center" valign="top">No, default is current directory.</td>
 
135
  </tr> 
 
136
  <tr>
 
137
    <td valign="top">tracknatives</td>
 
138
    <td valign="top">Test native methods. Note that testing native methods with
 
139
        Java 2 disables the JIT</td>
 
140
    <td align="center" valign="top">No, default to &quot;false&quot;.</td>
 
141
  </tr> 
 
142
  <tr>
 
143
    <td valign="top">classname</td>
 
144
    <td valign="top">the name of the class to analyze.</td>
 
145
    <td align="center" valign="top">Yes</td>
 
146
  </tr>
 
147
</table>
 
148
 
 
149
<h3><a name="nested">Nested Elements</a></h3>
 
150
 
 
151
<h4>classpath</h4>
 
152
<p><code>jpcoverage</code> supports a nested <code>&lt;classpath&gt;</code>
 
153
element, that represents a <a href="index.html#path">PATH like
 
154
structure</a>.</p>
 
155
 
 
156
<h4>jvmarg</h4>
 
157
 
 
158
<p>Additional parameters may be passed to the VM via nested <code>&lt;jvmarg&gt;</code>
 
159
attributes, for example:</p>
 
160
 
 
161
<pre></pre>
 
162
<blockquote>
 
163
<pre>&lt;jpcoverage home=&quot;c:\jprobe&quot; classname=&quot;MyClass&quot;&gt;
 
164
  &lt;jvmarg value=&quot;-classic&quot;/&gt;
 
165
  &lt;classpath path=&quot;.&quot;/&gt;
 
166
&lt;/jpcoverage&gt;
 
167
</pre>
 
168
</blockquote>
 
169
would run the coverage on &quot;MyClass&quot; in classic mode VM.
 
170
 
 
171
<p><code>&lt;jvmarg&gt;</code> allows all attributes described in <a
 
172
href="index.html#arg">Command line arguments</a>.</p>
 
173
 
 
174
<h4>arg</h4>
 
175
 
 
176
<p>
 
177
Parameters may be passed to the executed class via nested <tt>&lt;arg&gt;</tt>
 
178
attributes, as described in <a href="index.html#arg">Command line arguments</a>.
 
179
</p>
 
180
 
 
181
<h4>socket</h4>
 
182
<p>Define a host and port to connect to if you want to do remote viewing. 
 
183
</p>
 
184
<table border="1" cellpadding="2" cellspacing="0">
 
185
<tr>
 
186
  <td width="12%" valign="top"><b>Attribute</b></td>
 
187
  <td width="78%" valign="top"><b>Description</b></td>
 
188
  <td width="10%" valign="top"><b>Required</b></td>
 
189
</tr>
 
190
  <tr>
 
191
    <td valign="top">host</td> 
 
192
    <td valign="top">the host name/ip of the machine on which the Viewer is running</td>
 
193
    <td align="center">No, default to localhost</td>
 
194
  </tr>
 
195
  <tr>
 
196
    <td valign="top">port</td> 
 
197
    <td valign="top">The port number on which you will connect to the Viewer</td>
 
198
    <td align="center">No, default to 4444</td>
 
199
  </tr>  
 
200
</table>
 
201
 
 
202
 
 
203
 
 
204
<h4>filters</h4>
 
205
 
 
206
<p>Defines class/method filters based on pattern matching.
 
207
The syntax is filters is similar to a <a href="index.html#fileset">fileset</a>.
 
208
</p>
 
209
 
 
210
<table border="1" cellpadding="2" cellspacing="0">
 
211
<tr>
 
212
  <td width="12%" valign="top"><b>Attribute</b></td>
 
213
  <td width="78%" valign="top"><b>Description</b></td>
 
214
  <td width="10%" valign="top"><b>Required</b></td>
 
215
</tr>
 
216
  <tr>
 
217
    <td valign="top">defaultexclude</td> 
 
218
    <td valign="top">As a default, the coverage exclude all classes and methods.
 
219
     Default filters are equivalent to
 
220
<pre>
 
221
  &lt;filters&gt;
 
222
    &lt;exclude class=&quot;*&quot; method=&quot;*&quot;/&gt;
 
223
  &lt;/filters&gt;
 
224
</pre>  
 
225
        </td>
 
226
    <td align="center">No, default to "true"</td>
 
227
  </tr>
 
228
</table>
 
229
<p>
 
230
As seen above, nested elements are <b><tt>include</tt></b> and <b><tt>exclude</tt></b>
 
231
with a <tt>name</tt> attribute.
 
232
</p>
 
233
<blockquote>
 
234
<table border="1" cellpadding="2" cellspacing="0">
 
235
<tr>
 
236
  <td width="12%" valign="top"><b>Attribute</b></td>
 
237
  <td width="78%" valign="top"><b>Description</b></td>
 
238
  <td width="10%" valign="top"><b>Required</b></td>
 
239
</tr>
 
240
  <tr>
 
241
    <td valign="top">class</td> 
 
242
    <td valign="top">The class mask as a simple regular expression</td>
 
243
    <td align="center">No, default to *</td>
 
244
  </tr>
 
245
  <tr>
 
246
    <td valign="top">method</td> 
 
247
    <td valign="top">The method mask as a simple regular expression</td>
 
248
    <td align="center">No, default to *</td>
 
249
  </tr>
 
250
</table>
 
251
</blockquote>
 
252
 
 
253
<h3>Example of filters</h3>
 
254
<blockquote>
 
255
  <pre>&lt;filters&gt;
 
256
    &lt;include class=&quot;com.mycompany.*&quot; method=&quot;*&quot;/&gt;
 
257
    &lt;exclude class=&quot;com.mycompany.MyClass&quot; method=&quot;test*&quot;/&gt;
 
258
&lt;/filters&gt;</pre>
 
259
</blockquote>
 
260
 
 
261
reports the coverage on all packages, classes and methods from <tt>com.mycompany</tt>
 
262
except all methods starting by <tt>test</tt> on the class <tt>MyClass</tt>
 
263
in the package <tt>com.mycompany</tt>
 
264
 
 
265
<h4>triggers</h4>
 
266
 
 
267
<p>Define a number of events to use for interacting with the collection
 
268
of data performed during coverage. For example you may run a whole application
 
269
but only decide to collect data once it reaches a certain method and once it
 
270
exits another one.</p>
 
271
<p>
 
272
The only type of nested element is the <tt>method</tt> element (triggers are performed
 
273
on method) and it has the following attributes:
 
274
</p>
 
275
<table border="1" cellpadding="2" cellspacing="0">
 
276
<tr>
 
277
  <td width="12%" valign="top"><b>Attribute</b></td>
 
278
  <td width="78%" valign="top"><b>Description</b></td>
 
279
  <td width="10%" valign="top"><b>Required</b></td>
 
280
</tr>
 
281
  <tr>
 
282
    <td valign="top">name</td> 
 
283
    <td valign="top">The name of the method(s) as a regular expression. The name
 
284
        is the fully qualified name on the form <tt>package.classname.method</tt></td>
 
285
    <td align="center" valign="top">Yes</td>
 
286
  </tr>
 
287
  <tr>
 
288
    <td valign="top">event</td> 
 
289
    <td valign="top">the event on the method that will trigger the action. Must be
 
290
        &quot;enter&quot; or &quot;exit&quot;.</td>
 
291
    <td align="center" valign="top">Yes</td>
 
292
  </tr>
 
293
  <tr>
 
294
    <td valign="top">action</td> 
 
295
    <td valign="top">the action to execute. Must be one of &quot;clear&quot;,
 
296
        &quot;pause&quot;, &quot;resume&quot;, &quot;snapshot&quot;, &quot;suspend&quot;,
 
297
        or &quot;exit&quot;. They respectively clear recording, pause recording, 
 
298
        resume recording, take a snapshot, suspend the recording and exit the program.
 
299
</td>
 
300
    <td align="center" valign="top">Yes</td>
 
301
  </tr>
 
302
</table>
 
303
 
 
304
<h3>Example of triggers</h3>
 
305
<blockquote>
 
306
<pre>&lt;triggers&gt;
 
307
  &lt;method name=&quot;ClassName.*()&quot; event=&quot;enter&quot; action=&quot;snapshot&quot;/&gt;
 
308
  &lt;method name=&quot;ClassName.MethodName()&quot; event=&quot;exit&quot; action=&quot;exit&quot;/&gt;  
 
309
&lt;/triggers&gt;
 
310
</pre>
 
311
</blockquote>
 
312
 
 
313
<p>Will take a snapshot when it enters any method of the class <tt>ClassName</tt>
 
314
and will exit the program once it exits the method <tt>MethodName</tt> of the
 
315
same class.</p>
 
316
 
 
317
<hr>
 
318
<h2><a name="jpcovmerge">JPCovMerge</a></h2>
 
319
 
 
320
<h3>Description</h3>
 
321
 
 
322
<p>Perform the merge of several snapshots into a single one.</p>
 
323
 
 
324
<h3>Parameters</h3>
 
325
<table border="1" cellpadding="2" cellspacing="0">
 
326
<tr>
 
327
        <td width="12%" valign="top"><b>Attribute</b></td>
 
328
        <td width="78%" valign="top"><b>Description</b></td>
 
329
        <td width="10%" valign="top"><b>Required</b></td>
 
330
</tr>
 
331
<tr>
 
332
        <td valign="top">home</td>
 
333
    <td valign="top">The directory where is installed JProbe.</td>
 
334
    <td align="center" valign="top">Yes</td>
 
335
</tr>
 
336
<tr>
 
337
        <td valign="top">tofile</td>
 
338
        <td valign="top">the output filename that will be the result
 
339
        of the name.</td>
 
340
        <td align="center" valign="top">Yes</td>
 
341
</tr>
 
342
<tr>
 
343
        <td valign="top">verbose</td>
 
344
        <td valign="top">Perform the merge in verbose mode giving
 
345
        details about the snapshot processing.</td>
 
346
        <td align="center" valign="top">No. Default to false</td>
 
347
</tr>
 
348
</table>
 
349
 
 
350
<p>
 
351
<tt>jpcovmerge</tt> collects snapshots using the nested <a href="index.html#fileset"><code>&lt;FileSet&gt;</code></a>
 
352
element.
 
353
</p>
 
354
 
 
355
<h3>Example of merge</h3>
 
356
<blockquote>
 
357
<pre>&lt;jpcovreport home=&quot;c:\jprobe&quot; tofile=&quot;merge.jpc&quot; verbose=&quot;true&quot;&gt;
 
358
  &lt;fileset dir=&quot;./snapshots&quot;&gt;
 
359
    &lt;include name=&quot;snap*.jpc&quot;/&gt;
 
360
  &lt;/fileset&gt;
 
361
&lt;/jpcovreport&gt;
 
362
</pre>
 
363
</blockquote>
 
364
<p>
 
365
would run the merge in verbose mode on all snapshot files starting by <tt>snap</tt> in the
 
366
directory <tt>snapshots</tt>. The resulting file will be named <tt>merge.jpc</tt>.
 
367
</p>
 
368
 
 
369
<hr>
 
370
 
 
371
<h2>JPCovReport</h2>
 
372
 
 
373
<h3>Description</h3>
 
374
 
 
375
<p>Generate a readable/printable report of a snapshot. Note that you will need <a href="http://jakarta.apache.org/oro/index.html">Jakarta
 
376
Oro</a> in Ant classpath, to run the <tt>reference</tt> feature.</p>
 
377
 
 
378
<h3>Parameters</h3>
 
379
<table border="1" cellpadding="2" cellspacing="0">
 
380
<tr>
 
381
        <td width="12%" valign="top"><b>Attribute</b></td>
 
382
        <td width="78%" valign="top"><b>Description</b></td>
 
383
        <td width="10%" valign="top"><b>Required</b></td>
 
384
</tr>
 
385
<tr>
 
386
        <td valign="top">home</td>
 
387
    <td valign="top">The directory where is intalled JProbe.</td>
 
388
    <td align="center" valign="top">Yes</td>
 
389
</tr>
 
390
<tr>
 
391
        <td valign="top">format</td>
 
392
        <td valign="top">The format of the generated report. Must be &quot;xml&quot;, &quot;html&quot; or &quot;text&quot;</td>
 
393
        <td align="center" valign="top">No, default to &quot;html&quot;</td>
 
394
</tr>
 
395
<tr>
 
396
        <td valign="top">type</td>
 
397
        <td valign="top">The type of report to be generated. Must be &quot;executive&quot;,
 
398
        &quot;summary&quot;, &quot;detailed&quot; or &quot;verydetailed&quot;</td>
 
399
        <td align="center" valign="top">No. Default to &quot;detailed&quot;</td>
 
400
</tr>
 
401
<tr>
 
402
        <td valign="top">percent</td>
 
403
        <td valign="top">A numeric value for the threshold for printing methods. Must
 
404
        be between 0 and 100.</td>
 
405
        <td align="center" valign="top">No, default to 100</td>
 
406
</tr>
 
407
<tr>
 
408
        <td valign="top">snapshot</td>
 
409
        <td valign="top">The name of the snapshot file that is the source to the report.</td>
 
410
        <td align="center" valign="top">Yes</td>
 
411
</tr>
 
412
<tr>
 
413
        <td valign="top">tofile</td>
 
414
        <td valign="top">The name of the generated output file</td>
 
415
        <td align="center" valign="top">Yes</td>
 
416
</tr>
 
417
<tr>
 
418
        <td valign="top">includesource</td>
 
419
        <td valign="top">Include text of the source code lines. Only applies to
 
420
      format=&quot;xml&quot; and type=&quot;verydetailed&quot;</td>
 
421
        <td align="center" valign="top">No. Defaults to &quot;yes&quot;</td>
 
422
</tr>
 
423
</table>
 
424
 
 
425
<h4>sourcepath</h4>
 
426
 
 
427
<p>
 
428
Path to source files can be set via nested sourcepath elements that are <a href="index.html#path">PATH like structures</a>.
 
429
</p>
 
430
 
 
431
<h4>reference (only applies to format=&quot;xml&quot;)</h4>
 
432
 
 
433
<p>A reference is a set of classes whose coverage information will be checked
 
434
against. Since Coverage is only able to give you information about loaded
 
435
classes, it will only report classes that were at least used in some points in
 
436
your tests,
 
437
therefore you will not be able to know what classes are not exercised at all
 
438
during your tests. The reference is an additional feature that will analyze the
 
439
bytecode of all classes in a given classpath that match some filters and modify
 
440
the XML report accordingly. In short, it will:
 
441
</p>
 
442
 
 
443
<ul>
 
444
  <li>remove the classes that do not exists in the reference classpath. (For
 
445
    example you might have in your report some helper test classes that you do
 
446
    not want to appear in the report, but are unable to filter without adding
 
447
    hundred of filters for all your classes).</li>
 
448
  <li>add classes that exists in the reference set and match the filters but are
 
449
    not reported.</li>
 
450
  <li>remove abstract methods that are incorrectly reported in JProbe 3.0
 
451
    (should be fixed in a later SP)</li>
 
452
  <li>remove classes/methods that do not match the filters.</li>
 
453
</ul>
 
454
<blockquote>
 
455
  <h4>classpath
 
456
</h4>
 
457
 
 
458
  <p>
 
459
Path to the reference set of files can be set via nested classpath elements that are <a href="index.html#path">PATH like structures</a>.
 
460
</p>
 
461
 
 
462
  <h4>filters
 
463
</h4>
 
464
 
 
465
  <p>Nested elements are <b><tt>include</tt></b> and <b><tt>exclude</tt></b>
 
466
with a <tt>class </tt>and&nbsp; <tt>method </tt>attribute.
 
467
</p>
 
468
</blockquote>
 
469
<blockquote>
 
470
<table border="1" cellpadding="2" cellspacing="0">
 
471
<tr>
 
472
  <td width="12%" valign="top"><b>Attribute</b></td>
 
473
  <td width="78%" valign="top"><b>Description</b></td>
 
474
  <td width="10%" valign="top"><b>Required</b></td>
 
475
</tr>
 
476
  <tr>
 
477
    <td valign="top">class</td> 
 
478
    <td valign="top">The class mask as a simple regular expression</td>
 
479
    <td align="center">No, default to *</td>
 
480
  </tr>
 
481
  <tr>
 
482
    <td valign="top">method</td> 
 
483
    <td valign="top">The method mask as a simple regular expression</td>
 
484
    <td align="center">No, default to *</td>
 
485
  </tr>
 
486
</table>
 
487
</blockquote>
 
488
 
 
489
<h3>Example of report</h3>
 
490
<blockquote>
 
491
<pre>&lt;jpcovreport home=&quot;c:\jprobe&quot; snapshot=&quot;merge.jpc&quot; format=&quot;xml&quot; tofile=&quot;result.xml&quot;&gt;
 
492
  &lt;sourcepath path=&quot;./src&quot;/&gt;
 
493
  &lt;reference&gt;
 
494
    &lt;classpath path=&quot;./bin/classes&quot;/&gt;
 
495
    &lt;filters&gt;
 
496
      &lt;include class=&quot;com.mycompany.*&quot;/&gt;
 
497
      &lt;exclude class=&quot;com.mycompany.MyClass&quot; method=&quot;test*&quot;/&gt;
 
498
    &lt;/filters&gt;
 
499
  &lt;/reference&gt;
 
500
&lt;/jpcovreport&gt;
 
501
</pre>
 
502
</blockquote><p>
 
503
would generate the report of the file <tt>merge.jpc</tt> and write it to <tt>result.xml</tt>
 
504
using the source path <tt>src</tt>. As well, it will modify the result.xml by
 
505
analyzing all classes in the <tt>./bin/classes</tt> that are port of the package
 
506
<tt>com.mycompany</tt> except the method that start by <tt>test</tt> from the class <tt>MyClass</tt>.
 
507
</p>
 
508
 
 
509
<h3>Recommendation</h3>
 
510
 
 
511
<p>If you generate your main code and your testcases in a separate directory,
 
512
say bin/classes and test/classes. You should mostly end up with a reference such
 
513
as:</p>
 
514
<blockquote>
 
515
<pre>&lt;reference&gt;
 
516
&nbsp;&nbsp;&nbsp; &lt;classpath path=&quot;./bin/classes&quot;/&gt;
 
517
&lt;/reference&gt;</pre>
 
518
</blockquote>
 
519
<p>With such a reference, your XML report will be cleaned up against parasite
 
520
classes from your testcases (that as a common practice, generally match the
 
521
exact package structure of the class you exercise).</p>
 
522
<h3>HTML reports</h3>
 
523
<p>You will find in Ant etc directory a stylesheet called coverage-frames.xsl.
 
524
This file can be used to generate a framed report a la javadoc similar to the
 
525
one for JUnit. It needs either Xalan 1.2.2 or Xalan 2.x.</p>
 
526
<p>Xalan 1.2.2 (you must have xalan.jar and bsf.jar in your classpath)
 
527
</p>
 
528
<pre>&lt;style processor=&quot;xalan&quot; in=&quot;./reports/xml/results.xml&quot; out=&quot;./reports/html/dummy.file&quot;
 
529
 style=&quot;${ant.home}/etc/coverage-frames.xsl&quot;&gt;
 
530
        &lt;param name=&quot;output.dir&quot; expression=&quot;'${basedir}/reports/html'&quot;/&gt;
 
531
&lt;/style&gt;</pre>
 
532
<p>Xalan 2.x (note the parameter without single quote)</p>
 
533
<pre>&lt;style processor=&quot;trax&quot; in=&quot;./reports/xml/results.xml&quot; out=&quot;./reports/html/dummy.file&quot;
 
534
 style=&quot;${ant.home}/etc/coverage-frames.xsl&quot;&gt;
 
535
&nbsp; &lt;param name=&quot;output.dir&quot; expression=&quot;${basedir}/reports/html&quot;/&gt;
 
536
&lt;/style&gt;</pre>
 
537
 
 
538
</body>
 
539
</html>