Title: [PROPOSAL] Sitraka JProbe Coverage

Here is the task for Sitraka JProbe Coverage.
It has been tested under Windows w/ JProbe Server Side suite 2.8.0 and Solaris w/ 2.8.1.

There seems to be a argument parsing bug under solaris when running jpcovmerge (It does not even work manually).
I have passed this over to Sitraka and waiting for an answer.

HTML Documentation is included.

The following definitions need to be added to default.properties
jpcoverage=org.apache.tools.ant.taskdefs.optional.sitraka.coverage.Coverage
jpcovreport=org.apache.tools.ant.taskdefs.optional.sitraka.coverage.CovReport
jpcovmerge=org.apache.tools.ant.taskdefs.optional.sitraka.coverage.CovMerge

I gave it a try looping back to 'ant run-tests' FYI I included the coverage report for the tests.

There will be improvement very soon for jpcovreport filters. As of now filters are expressed as a string conforming to the real syntax. As the syntax, is not specified in the command line, nor in the help file, nor in the printed doc, nor in the online doc, I wasn't sure if the syntax was similar or not to other filters and didn't have time to try it.

Will do it asap and send a patch for it if necessary.

Cheers,

--
 St�phane Bailliez
 Software Engineer, Paris - France
 iMediation - http://www.imediation.com
 Disclaimer: All the opinions expressed above are mine and not those from my company.

 

Attachment: Socket.java
Description: Binary data

Attachment: CovMerge.java
Description: Binary data

Attachment: CovReport.java
Description: Binary data

Attachment: Filters.java
Description: Binary data

Attachment: Coverage.java
Description: Binary data

Attachment: Triggers.java
Description: Binary data

JProbe

by

Introduction

This task runs the tools from the JProbe suite.
For more information, visit http://www.sitraka.com. An evaluation version is available for download if you already don't own it.

This task has been written using JProbe Suite Server Side 2.8.1.

It is highly recommended to read the JProbe documentation to understand the values of the command line arguments described below. This document is less complete than the manual, it only gives the basic information and is not intended as a replacement to the manual.

Tasks


JPCoverage

Perform code covering functions by comparing source code line execution to the program�s source code as a whole.

Parameters

Attribute Description Required
home The directory where is intalled JProbe Coverage. Should look like <jprobehome>/Coverage Yes
vm Indicates which virtual machine to run. Must be one of "jdk117", "jdk118" or "java2".If "java2" is specified, the user is also required to specify a path via javahome, otherwise it will look in the registry for the default 1.2.x (Java 2) VM. No, default to registry 1.2.x key
javahome For Java 2 only, specifies the path of the jdk1.2.x virtual machine to be used. This is only valid when specifying the vm="java2". No, use only for java2
javaexe Similar to javahome, except this is the path to the java executable. No, use only for java2
applet Run an applet. The default is false, unless the file under analysis ends with htm or html. No, default is "false".
seedname Seed name for the temporary snapshot files (files will be named seed.jpc, seed1.jpc, seed2.jpc, ... No, default to "snapshot"
exitprompt Toggles display of the console prompt: "Press Enter to close this window." "always": Always displays the prompt. "never": Never displays the prompt. "error": Only displays prompt after an error. No, default is "never"
finalsnapshot Type of snapshot to send at program termination. Must be one of "none","coverage","all" No, default to "coverage"
recordfromstart Must be one of "coverage", "all", "none". If you want Coverage to start analyzing as soon as the program begins to run, use "all". If not, select "none". No, default to "coverage"
warnlevel Set warning level (0-3, where 0 is the least amount of warnings). No, default to 0
snapshotdir The path to the directory where snapshot files are stored. Choose a directory that is reachable by both the remote and local computers, and enter the same path on the command line and in the viewer. No, default to current directory
workingdir The physical path to the working directory for the VM. No, default is current directory.
tracknatives Test native methods. Note that testing native methods with Java 2 disables the JIT No, default to "false".
classname the name of the class to analyze. Yes

Nested Elements

classpath

jpcoverage supports a nested <classpath> element, that represents a PATH like structure.

jvmarg

Additional parameters may be passed to the VM via nested <jvmarg> attributes, for example:

<jpcoverage home="c:\jprobe\coverage" classname="MyClass"> <jvmarg value="-classic"/> <classpath path="."/> </jpcoverage>
would run the coverage on "MyClass" in classic mode VM.


<jvmarg> allows all attributes described in Command line arguments.

arg

Parameters may be passed to the executed class via nested <arg> attributes, as described in Command line arguments.

socket

Define a host and port to connect to if you want to do remote viewing.

Attribute Description Required
host the host name/ip of the machine on which the Viewer is running No, default to localhost
port The port number on which you will connect to the Viewer No, default to 4444

filters

Defines class/method filters based on pattern matching. The syntax is filters is similar to a fileset.

Attribute Description Required
defaultexclude As a default, the coverage does not cover objects coming from the jdk, Sun, Microsoft, and KLGroup. Default filters are equivalent to
  <filters>
    <exclude name="java.*" />
    <exclude name="javax.*" />
    <exclude name="com.sun.*" />
    <exclude name="sun.*" />
    <exclude name="com.ms.*" />
    <exclude name="com.klgroup.*" />						
  </filters>
No, default to "true"

As seen above, nested elements are include and exclude with a name attribute.

Attribute Description Required
name The name of the class/method as a regular _expression_ Yes

Example of filters

<filters> <include name="com.mycompany.*" /> <exclude name="com.mycompany.MyClass.test*()" /> </filters>
reports the coverage on all packages, classes and methods from com.mycompany except all methods starting by test on the class MyClass in the package com.mycompany

triggers

Define a number of events to use for interacting with the collection of data performed during coverage. For example you may run a whole application but only decide to collect data once it reaches a certain method and once it exits another one.

The only type of nested element is the method element (triggers are performed on method) and it has the following attributes:

Attribute Description Required
name The name of the method(s) as a regular _expression_. The name is the fully qualified name on the form package.classname.method Yes
event the event on the method that will trigger the action. Must be "enter" or "exit". Yes
action the action to execute. Must be one of "clear", "pause", "resume", "snapshot", "suspend", or "exit". They respectively clear recording, pause recording, resume recording, take a snapshot, suspend the recording and exit the program. Yes

Example of triggers

<triggers> <method name="ClassName.*()" event="enter" action=""/> <method name="ClassName.MethodName()" event="exit" action=""/> </triggers>

Will take a snapshot when it enters any method of the class ClassName and will exit the program once it exits the method MethodName of the same class.


JPCovMerge

Description

Perform the merge of several snapshots into a single one.

Parameters

Attribute Description Required
home The directory where is intalled JProbe Coverage. Should look like <jprobehome>/Coverage Yes
tofile the output filename that will be the result of the name. Yes
verbose Perform the merge in verbose mode giving details about the snapshot processing. No. Default to false

jpcovmerge collects snapshots using the nested <FileSet> element.

Example of merge

<jpcovreport home="c:\jprobe\coverage" tofile="merge.jpc" verbose="true";> <fileset dir="./snapshots"> <include name="snap*.jpc"/> </fileset> </jpcovreport>

would run the merge in verbose mode on all snapshot files starting by snap in the directory snapshots. The resulting file will be named merge.jpc.


JPCovReport

Description

Generate a readable/printable report of a snapshot.

Parameters

Attribute Description Required
home The directory where is intalled JProbe Coverage. Should look like <jprobehome>/Coverage Yes
format The format of the generated report. Must be "html" or "text" No, default to "html"
type The type of report to be generated. Must be "executive", "summary", "detailed" or "verydetailed" No. Default to "detailed"
percent A numeric value for the threshold for printing methods. Must be between 0 and 100. No, default to 100
snapshot The name of the snapshot file that is the source to the report. Yes
tofile The name of the generated output file Yes

sourcepath

Path to source files can be set via nested sourcepath elements that are PATH like structures.

Example of report

<jpcovreport home="c:\jprobe\coverage" snapshot="merge.jpc" tofile="result.html"> <sourcepath path="./src"/> </jpcovreport>

would generate the report of the file merge.jpc and write it to result.html using the source path src

Title: JProbe (tm) Coverage Report of org.apache.tools.ant.Main

JProbeTM Coverage Report of org.apache.tools.ant.Main

JProbe Coverage version:2.8.1
programDate02-Feb-01 7:04:02 PM
elapsedTime6125 ms
machineNamearamis
processorSpeed450
osNameSunOS
osVersion5
machineTypesun4u
Line Information:Available


Executive Summary
Name


Total
Calls


76942
Methods
Missed

77.8%
Total
Methods

1970
Lines
Missed

82.6%
Total
Lines

11441
org.apache.crimson.parser4458948.3%20367.1%2159
org.apache.tools.ant1140545.3%28959.2%1744
org.apache.crimson.util990468.4%1985.3%245
org.xml.sax.helpers858260.5%8660.9%248
org.apache.tools.ant.types178874.9%17182.9%753
org.apache.tools.ant.taskdefs36292.3%60195.0%3542
org.xml.sax27565.9%4466.7%81
org.apache.tools.ant.taskdefs.optional.junit2384.1%11389.6%536
org.apache.crimson.jaxp666.7%1544.4%36
org.apache.xalan.processor483.3%2484.8%164
org.apache.tools.ant.taskdefs.optional396.1%7798.6%425
org.apache.xml.utils188.9%996.8%31
org.apache.tools.ant.taskdefs.optional.vss0100.0%22100.0%111
org.apache.tools.ant.taskdefs.optional.javacc0100.0%42100.0%159
org.apache.tools.ant.taskdefs.optional.jsp0100.0%9100.0%104
org.apache.tools.ant.taskdefs.optional.clearcase0100.0%67100.0%244
org.apache.tools.ant.taskdefs.optional.sitraka.coverage0100.0%49100.0%277
org.apache.tools.ant.taskdefs.optional.depend0100.0%14100.0%139
org.apache.tools.ant.taskdefs.optional.dotnet0100.0%77100.0%241
org.apache.tools.ant.taskdefs.optional.jlink0100.0%11100.0%49
org.apache.tools.ant.taskdefs.optional.metamata0100.0%7100.0%67
org.apache.tools.ant.taskdefs.optional.ejb0100.0%16100.0%68
org.apache.tools.ant.taskdefs.optional.sound0100.0%5100.0%18


Per class summary for package org.apache.crimson.parser
Name


Total
Calls


44589
Methods
Missed

48.3%
Total
Methods

203
Lines
Missed

67.1%
Total
Lines

2159
InputEntity2446738.2%3462.7%424
Parser21724955.2%8776.4%1222
ElementValidator8530.0%50.0%6
Parser2$NameCacheEntry7470.0%20.0%7
Parser2$NameCache69833.3%34.8%21
SimpleHashtable27263.6%1165.0%80
Parser2$DocLocator2550.0%50.0%5
XMLReaderImpl1250.0%1652.3%107
XmlReader1050.0%1639.5%167
SimpleHashtable$Entry50.0%10.0%5
InternalEntity50.0%10.0%3
EntityDecl50.0%10.0%1
XmlReader$Utf8Reader40.0%272.5%80
XmlReader$BaseReader333.3%323.1%13
Parser2$NullHandler284.6%1384.6%13
Parser2$Catalog20.0%20.0%3
ElementDecl0100.0%1100.0%2


Per class summary for package org.apache.tools.ant
Name


Total
Calls


11405
Methods
Missed

45.3%
Total
Methods

289
Lines
Missed

59.2%
Total
Lines

1744
ProjectHelper17200.0%1726.7%86
RuntimeConfigurable142744.4%951.7%29
Project138256.3%7162.2%436
ProjectHelper$AbstractHandler130920.0%515.4%13
BuildEvent120645.5%1134.5%29
Task101636.8%1931.6%38
IntrospectionHelper80242.9%1436.4%118
ProjectHelper$TaskHandler7210.0%516.1%31
ProjectHelper$NestedElementHandler4420.0%417.2%29
DefaultLogger29728.6%1434.0%50
Target22057.9%1964.9%57
ProjectHelper$TargetHandler1340.0%39.5%42
Location13020.0%511.1%18
IntrospectionHelper$11280.0%20.0%2
IntrospectionHelper$31260.0%20.0%3
ProjectHelper$ProjectHandler9614.3%719.2%52
IntrospectionHelper$115450.0%266.7%3
IntrospectionHelper$13450.0%20.0%3
ProjectHelper$DataTypeHandler420.0%420.0%15
IntrospectionHelper$2380.0%20.0%4
PathTokenizer300.0%336.8%19
IntrospectionHelper$16140.0%225.0%4
IntrospectionHelper$14950.0%266.7%3
BuildException745.5%1158.6%29
Main564.3%1469.3%254
ProjectHelper$RootHandler420.0%556.2%16
IntrospectionHelper$15150.0%283.3%6
UnknownElement0100.0%6100.0%38
TaskAdapter0100.0%4100.0%14
DirectoryScanner0100.0%23100.0%303


Per class summary for package org.apache.crimson.util
Name


Total
Calls


9904
Methods
Missed

68.4%
Total
Methods

19
Lines
Missed

85.3%
Total
Lines

245
XmlChars990260.0%1073.8%103
MessageCatalog277.8%993.7%142


Per class summary for package org.xml.sax.helpers
Name


Total
Calls


8582
Methods
Missed

60.5%
Total
Methods

86
Lines
Missed

60.9%
Total
Lines

248
AttributesImpl338065.4%2670.2%121
XMLReaderAdapter219340.9%2234.0%50
XMLReaderAdapter$AttributesAdapter206712.5%810.0%10
AttributeListImpl94166.7%1263.3%49
DefaultHandler194.4%1894.4%18


Per class summary for package org.apache.tools.ant.types
Name


Total
Calls


1788
Methods
Missed

74.9%
Total
Methods

171
Lines
Missed

82.9%
Total
Lines

753
Path112854.2%2472.0%164
DataType25166.7%968.0%25
PatternSet18076.5%1787.1%101
FileSet11480.0%1588.8%80
PatternSet$NameEntry6685.7%792.9%14
Path$PathElement1625.0%444.4%9
Commandline1484.2%1989.9%99
CommandlineJava766.7%2166.1%59
Environment633.3%354.5%11
Reference340.0%550.0%14
CommandlineJava$SysProperties183.3%692.0%25
Commandline$Argument183.3%690.0%10
Environment$Variable187.5%888.2%17
Commandline$Marker0100.0%2100.0%10
Mapper0100.0%11100.0%71
ZipFileSet0100.0%9100.0%31
EnumeratedAttribute0100.0%5100.0%13


Per class summary for package org.apache.tools.ant.taskdefs
Name


Total
Calls


362
Methods
Missed

92.3%
Total
Methods

601
Lines
Missed

95.0%
Total
Lines

3542
Property15270.4%2779.6%137
MatchingTask5275.0%1285.7%35
Copy2788.2%1786.9%122
Available1992.3%1395.9%49
Ant1570.0%1084.2%95
CallTarget1540.0%552.9%17
Mkdir1366.7%392.9%14
Delete1188.9%1890.5%105
ExecuteOn1072.7%1187.0%69
ExecTask889.5%1988.5%78
FixCRLF687.5%894.1%119
Javadoc595.2%6393.2%339
Zip590.9%2296.8%219
Chmod492.9%1482.4%34
Javac495.2%4289.5%124
Filter383.3%696.9%32
Javadoc$GroupArgument380.0%575.0%8
GZip283.3%696.8%31
Jar283.3%688.2%34
Tar285.7%796.4%56
UpToDate271.4%786.8%38
Tstamp166.7%388.9%18
Touch187.5%895.7%46
Move0100.0%4100.0%56
Java0100.0%22100.0%90
Deltree0100.0%4100.0%27
Echo0100.0%7100.0%34
XSLTProcess0100.0%13100.0%106
War0100.0%9100.0%38
Expand0100.0%5100.0%51
AntStructure0100.0%8100.0%130
Copyfile0100.0%6100.0%25
ExecuteOn$FileDirBoth0100.0%2100.0%2
GenerateKey0100.0%14100.0%96
Replace0100.0%19100.0%121
Cvs0100.0%12100.0%73
SendEmail0100.0%8100.0%51
Exit0100.0%3100.0%6
Taskdef0100.0%8100.0%34
GUnzip0100.0%4100.0%39
Transform0100.0%9100.0%62
Javadoc$LinkArgument0100.0%7100.0%12
Get0100.0%8100.0%81
SignJar0100.0%14100.0%75
SQLExec0100.0%23100.0%202
Rename0100.0%5100.0%19
CompileTask0100.0%4100.0%19
Untar0100.0%4100.0%44
Rmic0100.0%21100.0%127
Patch0100.0%9100.0%38
Javadoc$DocletInfo0100.0%9100.0%19
Copydir0100.0%8100.0%46


Per class summary for package org.xml.sax
Name


Total
Calls


275
Methods
Missed

65.9%
Total
Methods

44
Lines
Missed

66.7%
Total
Lines

81
HandlerBase26186.7%1586.7%15
InputSource850.0%1459.1%22
SAXParseException455.6%955.6%27
SAXException266.7%676.5%17


Per class summary for package org.apache.tools.ant.taskdefs.optional.junit
Name


Total
Calls


23
Methods
Missed

84.1%
Total
Methods

113
Lines
Missed

89.6%
Total
Lines

536
JUnitTask872.0%2586.4%154
BaseTest483.3%1264.3%28
XMLResultAggregator375.0%1290.9%77
FormatterElement290.9%1192.3%39
BatchTest275.0%887.5%48
AggregateTransformer293.1%2996.6%146
JUnitTest293.8%1690.9%44


Per class summary for package org.apache.crimson.jaxp
Name


Total
Calls


6
Methods
Missed

66.7%
Total
Methods

15
Lines
Missed

44.4%
Total
Lines

36
SAXParserImpl371.4%738.5%26
SAXParserFactoryImpl250.0%440.0%5
DocumentBuilderFactoryImpl175.0%480.0%5


Per class summary for package org.apache.xalan.processor
Name


Total
Calls


4
Methods
Missed

83.3%
Total
Methods

24
Lines
Missed

84.8%
Total
Lines

164
TransformerFactoryImpl483.3%2484.8%164


Per class summary for package org.apache.tools.ant.taskdefs.optional
Name


Total
Calls


3
Methods
Missed

96.1%
Total
Methods

77
Lines
Missed

98.6%
Total
Lines

425
Cab194.1%1796.4%111
PropertyFile194.1%1798.2%57
Javah195.0%2099.2%128
Test0100.0%7100.0%20
RenameExtensions0100.0%6100.0%40
Native2Ascii0100.0%10100.0%69


Per class summary for package org.apache.xml.utils
Name


Total
Calls


1
Methods
Missed

88.9%
Total
Methods

9
Lines
Missed

96.8%
Total
Lines

31
DefaultErrorHandler188.9%996.8%31

Reply via email to