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

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.optional.sitraka.Coverage

public class Coverage
extends Task

Convenient task to run Sitraka JProbe Coverage from Ant. 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

Author:
Stephane Bailliez

Inner 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  java.lang.String exitPrompt
          this is a somewhat annoying thing, set it to never
protected  java.util.Vector filesets
           
protected  Filters filters
           
protected  java.lang.String finalSnapshot
           
protected  java.lang.String function
           
protected  java.io.File home
           
protected  java.io.File inputFile
           
protected  java.io.File javaExe
           
protected  java.lang.String recordFromStart
           
protected  java.lang.String seedName
           
protected  java.io.File snapshotDir
           
protected  Socket socket
           
protected  boolean trackNatives
           
protected  Triggers triggers
           
protected  java.lang.String vm
           
protected  int warnLevel
           
protected  java.io.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()
           
 
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()
          the command arguments
 Path createClasspath()
          classpath to run the files
 Filters createFilters()
           
 Commandline.Argument createJvmarg()
          the jvm arguments
protected  java.io.File createParamFile()
          create the parameter file from the given options.
 Socket createSocket()
           
protected  java.io.File createTmpFile()
          create a temporary file in the current dir (For JDK1.1 support)
 Triggers createTriggers()
           
 void execute()
          execute the jplauncher by providing a parameter file
protected  java.lang.String[] getParameters()
          return the command line parameters.
 void setApplet(boolean value)
          default to false unless file is htm or html
 void setClassname(java.lang.String value)
          classname to run as standalone or runner for filesets
 void setExitprompt(java.lang.String value)
          always, error, never
 void setFinalsnapshot(java.lang.String value)
          none, coverage, all. can be null, default to none
 void setHome(java.io.File value)
          set the coverage home directory where are libraries, jars and jplauncher
 void setInputfile(java.io.File value)
           
 void setJavaexe(java.io.File value)
           
 void setRecordfromstart(Coverage.Recordfromstart value)
          all, coverage, none
 void setSeedname(java.lang.String value)
          seed name for snapshot file. can be null, default to snap
 void setSnapshotdir(java.io.File value)
           
 void setTracknatives(boolean value)
           
 void setVm(Coverage.Javavm value)
          jdk117, jdk118 or java2, can be null, default to java2
 void setWarnlevel(java.lang.Integer value)
           
 void setWorkingdir(java.io.File value)
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

home

protected java.io.File home

cmdl

protected Commandline cmdl

cmdlJava

protected CommandlineJava cmdlJava

function

protected java.lang.String function

seedName

protected java.lang.String seedName

inputFile

protected java.io.File inputFile

javaExe

protected java.io.File javaExe

vm

protected java.lang.String vm

applet

protected boolean applet

exitPrompt

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

filters

protected Filters filters

triggers

protected Triggers triggers

finalSnapshot

protected java.lang.String finalSnapshot

recordFromStart

protected java.lang.String recordFromStart

snapshotDir

protected java.io.File snapshotDir

workingDir

protected java.io.File workingDir

trackNatives

protected boolean trackNatives

socket

protected Socket socket

warnLevel

protected int warnLevel

filesets

protected java.util.Vector filesets
Constructor Detail

Coverage

public Coverage()
Method Detail

setHome

public void setHome(java.io.File value)
set the coverage home directory where are libraries, jars and jplauncher

setSeedname

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

setInputfile

public void setInputfile(java.io.File value)

setJavaexe

public void setJavaexe(java.io.File value)

setVm

public void setVm(Coverage.Javavm value)
jdk117, jdk118 or java2, can be null, default to java2

setApplet

public void setApplet(boolean value)
default to false unless file is htm or html

setExitprompt

public void setExitprompt(java.lang.String value)
always, error, never

createFilters

public Filters createFilters()

createTriggers

public Triggers createTriggers()

createSocket

public Socket createSocket()

setFinalsnapshot

public void setFinalsnapshot(java.lang.String value)
none, coverage, all. can be null, default to none

setRecordfromstart

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

setWarnlevel

public void setWarnlevel(java.lang.Integer value)

setSnapshotdir

public void setSnapshotdir(java.io.File value)

setWorkingdir

public void setWorkingdir(java.io.File value)

setTracknatives

public void setTracknatives(boolean value)

createJvmarg

public Commandline.Argument createJvmarg()
the jvm arguments

createArg

public Commandline.Argument createArg()
the command arguments

createClasspath

public Path createClasspath()
classpath to run the files

setClassname

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

addFileset

public void addFileset(FileSet fs)
the classnames to execute

execute

public void execute()
             throws BuildException
execute the jplauncher by providing a parameter file
Overrides:
execute in class Task
Following copied from class: org.apache.tools.ant.Task
Throws:
BuildException - if someting goes wrong with the build

checkOptions

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

getParameters

protected java.lang.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=) if they are too numerous.

createParamFile

protected java.io.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.

createTmpFile

protected java.io.File createTmpFile()
create a temporary file in the current dir (For JDK1.1 support)


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.