org.jacoco.ant
Class AbstractCoverageTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.jacoco.ant.AbstractCoverageTask
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AgentTask, CoverageTask

public class AbstractCoverageTask
extends org.apache.tools.ant.Task

Base class for all coverage tasks that require agent options


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
protected AbstractCoverageTask()
          Create default agent options
 
Method Summary
protected  String getLaunchingArgument()
          Creates JVM argument to launch with the specified JaCoCo agent jar and the current options
 boolean isEnabled()
           
 void setAddress(String address)
          Sets the IP address or hostname to bind to when output method is tcp server or connect to when the output method is tcp client.
 void setAppend(boolean append)
          Append execution coverage data if a coverage file is already present.
 void setClassdumpdir(File dir)
          Sets the directory where all class files seen by the agent should be dumped to.
 void setDestfile(File file)
          Sets the location to write coverage execution data to.
 void setDumpOnExit(boolean dumpOnExit)
          Dump coverage data on VM termination.
 void setEnabled(boolean enabled)
          Sets whether or not the current task is enabled
 void setExclClassLoader(String exclClassLoader)
          List of wildcard patterns for classloaders that JaCoCo will not instrument classes from.
 void setExcludes(String excludes)
          List of wildcard patterns classes to exclude from instrumentation.
 void setInclBootstrapClasses(boolean include)
          Sets whether classes from the bootstrap classloader should be instrumented.
 void setInclNoLocationClasses(boolean include)
          Sets whether classes without source location should be instrumented.
 void setIncludes(String includes)
          List of wildcard patterns classes to include for instrumentation.
 void setJmx(boolean jmx)
          Sets whether the agent should expose functionality via JMX.
 void setOutput(String output)
          Sets the output method.
 void setPort(int port)
          Sets the Port to bind to when the output method is tcp server or connect to when the output method is tcp client.
 void setSessionId(String id)
          Sets the session identifier.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCoverageTask

protected AbstractCoverageTask()
Create default agent options

Method Detail

isEnabled

public boolean isEnabled()
Returns:
Whether or not the current task is enabled

setEnabled

public void setEnabled(boolean enabled)
Sets whether or not the current task is enabled

Parameters:
enabled - Enablement state of the task

setDestfile

public void setDestfile(File file)
Sets the location to write coverage execution data to. Default is jacoco.exec.

Parameters:
file - Location to write coverage execution data to

setAppend

public void setAppend(boolean append)
Append execution coverage data if a coverage file is already present. Default is true

Parameters:
append - true to append execution data to an existing file

setIncludes

public void setIncludes(String includes)
List of wildcard patterns classes to include for instrumentation. Default is *

Parameters:
includes - Wildcard pattern of included classes

setExcludes

public void setExcludes(String excludes)
List of wildcard patterns classes to exclude from instrumentation. Default is the empty string, no classes excluded

Parameters:
excludes - Wildcard pattern of excluded classes

setExclClassLoader

public void setExclClassLoader(String exclClassLoader)
List of wildcard patterns for classloaders that JaCoCo will not instrument classes from. Default is sun.reflect.DelegatingClassLoader

Parameters:
exclClassLoader - Wildcard pattern of class loaders to exclude

setInclBootstrapClasses

public void setInclBootstrapClasses(boolean include)
Sets whether classes from the bootstrap classloader should be instrumented.

Parameters:
include - true if bootstrap classes should be instrumented

setInclNoLocationClasses

public void setInclNoLocationClasses(boolean include)
Sets whether classes without source location should be instrumented.

Parameters:
include - true if classes without source location should be instrumented

setSessionId

public void setSessionId(String id)
Sets the session identifier. Default is a auto-generated id

Parameters:
id - session identifier

setDumpOnExit

public void setDumpOnExit(boolean dumpOnExit)
Dump coverage data on VM termination. Default is true

Parameters:
dumpOnExit - true to write coverage data on VM termination

setOutput

public void setOutput(String output)
Sets the output method. Default is file

Parameters:
output - Output method

setAddress

public void setAddress(String address)
Sets the IP address or hostname to bind to when output method is tcp server or connect to when the output method is tcp client. Default is localhost

Parameters:
address - Address to bind or connect to

setPort

public void setPort(int port)
Sets the Port to bind to when the output method is tcp server or connect to when the output method is tcp client. Default is 6300

Parameters:
port - port to bind to or connect to

setClassdumpdir

public void setClassdumpdir(File dir)
Sets the directory where all class files seen by the agent should be dumped to.

Parameters:
dir - dump output location

setJmx

public void setJmx(boolean jmx)
Sets whether the agent should expose functionality via JMX.

Parameters:
jmx - true if JMX should be enabled

getLaunchingArgument

protected String getLaunchingArgument()
Creates JVM argument to launch with the specified JaCoCo agent jar and the current options

Returns:
JVM Argument to pass to new VM


Copyright © 2009–2019 Mountainminds GmbH & Co. KG. All rights reserved.