org.apache.tools.ant.taskdefs.optional.sitraka

Class Coverage

public class Coverage extends CovBase

Runs Sitraka JProbe Coverage. Options are pretty numerous, you'd better check the manual for a full descriptions of options. (not that simple since they differ from the online help, from the usage command line and from the examples...)

For additional information, visit www.sitraka.com

UNKNOWN: name="jpcoverage" category="metrics"

Nested Class Summary
static classCoverage.Finalsnapshot
static classCoverage.Javavm
static classCoverage.Recordfromstart
Field Summary
protected booleanapplet
protected Commandlinecmdl
protected CommandlineJavacmdlJava
protected StringexitPrompt
this is a somewhat annoying thing, set it to never
protected Vectorfilesets
protected Filtersfilters
protected StringfinalSnapshot
protected Stringfunction
protected FileinputFile
protected FilejavaExe
protected StringrecordFromStart
protected StringseedName
protected FilesnapshotDir
protected Socketsocket
protected booleantrackNatives
protected Triggerstriggers
protected Stringvm
protected intwarnLevel
protected FileworkingDir
Constructor Summary
Coverage()
Method Summary
voidaddFileset(FileSet fs)
the classnames to execute.
protected voidcheckOptions()
wheck what is necessary to check, Coverage will do the job for us
Commandline.ArgumentcreateArg()
Adds a command argument.
PathcreateClasspath()
classpath to run the files.
FilterscreateFilters()
Defines class/method filters based on pattern matching.
Commandline.ArgumentcreateJvmarg()
Adds a JVM argument.
protected FilecreateParamFile()
create the parameter file from the given options.
SocketcreateSocket()
Define a host and port to connect to if you want to do remote viewing.
TriggerscreateTriggers()
Defines events to use for interacting with the collection of data performed during coverage.
voidexecute()
execute the jplauncher by providing a parameter file
protected String[]getParameters()
return the command line parameters.
voidsetApplet(boolean value)
If true, run an applet.
voidsetClassname(String value)
classname to run as standalone or runner for filesets.
voidsetExitprompt(String value)
Toggles display of the console prompt: always, error, never
voidsetFinalsnapshot(String value)
Type of snapshot to send at program termination: none, coverage, all.
voidsetInputfile(File value)
voidsetJavaexe(File value)
Path to the java executable.
voidsetRecordfromstart(Coverage.Recordfromstart value)
"all", "coverage", or "none".
voidsetSeedname(String value)
seed name for snapshot file.
voidsetSnapshotdir(File value)
The path to the directory where snapshot files are stored.
voidsetTracknatives(boolean value)
If true, track native methods.
voidsetVm(Coverage.Javavm value)
Indicates which virtual machine to run: "jdk117", "jdk118" or "java2".
voidsetWarnlevel(Integer value)
Set warning level (0-3, where 0 is the least amount of warnings).
voidsetWorkingdir(File value)
The physical path to the working directory for the VM.

Field Detail

applet

protected boolean applet

cmdl

protected Commandline cmdl

cmdlJava

protected CommandlineJava cmdlJava

exitPrompt

protected String exitPrompt
this is a somewhat annoying thing, set it to never

filesets

protected Vector filesets

filters

protected Filters filters

finalSnapshot

protected String finalSnapshot

function

protected String function

inputFile

protected File inputFile

javaExe

protected File javaExe

recordFromStart

protected String recordFromStart

seedName

protected String seedName

snapshotDir

protected File snapshotDir

socket

protected Socket socket

trackNatives

protected boolean trackNatives

triggers

protected Triggers triggers

vm

protected String vm

warnLevel

protected int warnLevel

workingDir

protected File workingDir

Constructor Detail

Coverage

public Coverage()

Method Detail

addFileset

public void addFileset(FileSet fs)
the classnames to execute.

checkOptions

protected void checkOptions()
wheck what is necessary to check, Coverage will do the job for us

createArg

public Commandline.Argument createArg()
Adds a command argument.

createClasspath

public Path createClasspath()
classpath to run the files.

createFilters

public Filters createFilters()
Defines class/method filters based on pattern matching. The syntax is filters is similar to a fileset.

createJvmarg

public Commandline.Argument createJvmarg()
Adds a JVM argument.

createParamFile

protected File createParamFile()
create the parameter file from the given options. The file is created with a random name in the current directory.

Returns: the file object where are written the configuration to run JProbe Coverage

Throws: BuildException thrown if something bad happens while writing the arguments to the file.

createSocket

public Socket createSocket()
Define a host and port to connect to if you want to do remote viewing.

createTriggers

public Triggers createTriggers()
Defines 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.

execute

public void execute()
execute the jplauncher by providing a parameter file

getParameters

protected String[] getParameters()
return the command line parameters. Parameters can either be passed to the command line and stored to a file (then use the -jp_input=<filename>) if they are too numerous.

setApplet

public void setApplet(boolean value)
If true, run an applet.

setClassname

public void setClassname(String value)
classname to run as standalone or runner for filesets.

setExitprompt

public void setExitprompt(String value)
Toggles display of the console prompt: always, error, never

setFinalsnapshot

public void setFinalsnapshot(String value)
Type of snapshot to send at program termination: none, coverage, all. Can be null, default to none

setInputfile

public void setInputfile(File value)

UNKNOWN: ignore="true"

setJavaexe

public void setJavaexe(File value)
Path to the java executable.

setRecordfromstart

public void setRecordfromstart(Coverage.Recordfromstart value)
"all", "coverage", or "none".

setSeedname

public void setSeedname(String value)
seed name for snapshot file. Can be null, default to snap

setSnapshotdir

public void setSnapshotdir(File value)
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.

setTracknatives

public void setTracknatives(boolean value)
If true, track native methods.

setVm

public void setVm(Coverage.Javavm value)
Indicates which virtual machine to run: "jdk117", "jdk118" or "java2". Can be null, default to "java2".

setWarnlevel

public void setWarnlevel(Integer value)
Set warning level (0-3, where 0 is the least amount of warnings).

setWorkingdir

public void setWorkingdir(File value)
The physical path to the working directory for the VM.
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.