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

Nested Class Summary

static class
Coverage.Finalsnapshot
static class
Coverage.Javavm
static class
Coverage.Recordfromstart

Field Summary

protected boolean
applet
protected Commandline
cmdl
protected CommandlineJava
cmdlJava
protected String
exitPrompt
this is a somewhat annoying thing, set it to never
protected Vector
filesets
protected Filters
filters
protected String
finalSnapshot
protected String
function
protected File
inputFile
protected File
javaExe
protected String
recordFromStart
protected String
seedName
protected File
snapshotDir
protected Socket
socket
protected boolean
trackNatives
protected Triggers
triggers
protected String
vm
protected int
warnLevel
protected File
workingDir

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Constructor Summary

Coverage()
Sole constructor.

Method Summary

void
addFileset(FileSet fs)
the classnames to execute.
protected void
checkOptions()
wheck what is necessary to check, Coverage will do the job for us
Commandline.Argument
createArg()
Adds a command argument.
Path
createClasspath()
classpath to run the files.
Filters
createFilters()
Defines class/method filters based on pattern matching.
Commandline.Argument
createJvmarg()
Adds a JVM argument.
protected File
createParamFile()
create the parameter file from the given options.
Socket
createSocket()
Define a host and port to connect to if you want to do remote viewing.
Triggers
createTriggers()
Defines events to use for interacting with the collection of data performed during coverage.
void
execute()
execute the jplauncher by providing a parameter file
protected String[]
getParameters()
return the command line parameters.
void
setApplet(boolean value)
If true, run an applet.
void
setClassname(String value)
classname to run as standalone or runner for filesets.
void
setExitprompt(String value)
Toggles display of the console prompt: always, error, never
void
setFinalsnapshot(String value)
Type of snapshot to send at program termination: none, coverage, all.
void
setInputfile(File value)
void
setJavaexe(File value)
Path to the java executable.
void
setRecordfromstart(Coverage.Recordfromstart value)
"all", "coverage", or "none".
void
setSeedname(String value)
seed name for snapshot file.
void
setSnapshotdir(File value)
The path to the directory where snapshot files are stored.
void
setTracknatives(boolean value)
If true, track native methods.
void
setVm(Coverage.Javavm value)
Indicates which virtual machine to run: "jdk117", "jdk118" or "java2".
void
setWarnlevel(Integer value)
Set warning level (0-3, where 0 is the least amount of warnings).
void
setWorkingdir(File value)
The physical path to the working directory for the VM.

Methods inherited from class org.apache.tools.ant.taskdefs.optional.sitraka.CovBase

createTempFile, findCoverageJar, findExecutable, getHome, getParamFileArgument, isJProbe4Plus, setHome

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Field Details

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 Details

Coverage

public Coverage()
Sole constructor.

Method Details

addFileset

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


checkOptions

protected void checkOptions()
            throws BuildException
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()
            throws BuildException
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()
            throws BuildException
execute the jplauncher by providing a parameter file
Overrides:
execute in interface Task


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)


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-2005 Apache Software Foundation. All Rights Reserved.