public final class AgentOptions
extends java.lang.Object
key1=value1,key2=value2,key3=value3
Modifier and Type | Class | Description |
---|---|---|
static class |
AgentOptions.OutputMode |
Possible values for
OUTPUT . |
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ADDRESS |
The IP address or DNS name the tcpserver binds to or the tcpclient
connects to.
|
static java.lang.String |
APPEND |
Specifies whether execution data should be appended to the output file.
|
static java.lang.String |
CLASSDUMPDIR |
Specifies where the agent dumps all class files it encounters.
|
static java.lang.String |
DEFAULT_ADDRESS |
Default value for the "address" agent option.
|
static java.lang.String |
DEFAULT_DESTFILE |
Default value for the "destfile" agent option.
|
static int |
DEFAULT_PORT |
Default value for the "port" agent option.
|
static java.lang.String |
DESTFILE |
Specifies the output file for execution data.
|
static java.lang.String |
DUMPONEXIT |
Specifies whether the agent will automatically dump coverage data on VM
exit.
|
static java.lang.String |
EXCLCLASSLOADER |
Wildcard expression for class loaders names for classes that should be
excluded from code coverage.
|
static java.lang.String |
EXCLUDES |
Wildcard expression for class names that should be excluded from code
coverage.
|
static java.lang.String |
INCLBOOTSTRAPCLASSES |
Specifies whether also classes from the bootstrap classloader should be
instrumented.
|
static java.lang.String |
INCLNOLOCATIONCLASSES |
Specifies whether also classes without a source location should be
instrumented.
|
static java.lang.String |
INCLUDES |
Wildcard expression for class names that should be included for code
coverage.
|
static java.lang.String |
JMX |
Specifies whether the agent should expose functionality via JMX under the
name "org.jacoco:type=Runtime".
|
static java.lang.String |
OUTPUT |
Specifies the output mode.
|
static java.lang.String |
PORT |
The port the tcpserver binds to or the tcpclient connects to.
|
static java.lang.String |
SESSIONID |
Specifies a session identifier that is written with the execution data.
|
Constructor | Description |
---|---|
AgentOptions() |
New instance with all values set to default.
|
AgentOptions(java.lang.String optionstr) |
New instance parsed from the given option string.
|
AgentOptions(java.util.Properties properties) |
New instance read from the given
Properties object. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getAddress() |
Gets the hostname or IP address to listen to when output is
tcpserver or connect to when output is
tcpclient |
boolean |
getAppend() |
Returns whether the output should be appended to an existing file.
|
java.lang.String |
getClassDumpDir() |
Returns the location of the directory where class files should be dumped
to.
|
java.lang.String |
getDestfile() |
Returns the output file location.
|
boolean |
getDumpOnExit() |
Returns whether coverage data should be dumped on exit.
|
java.lang.String |
getExclClassloader() |
Returns the wildcard expression for excluded class loaders.
|
java.lang.String |
getExcludes() |
Returns the wildcard expression for classes to exclude.
|
boolean |
getInclBootstrapClasses() |
Returns whether classes from the bootstrap classloader should be
instrumented.
|
boolean |
getInclNoLocationClasses() |
Returns whether classes without source location should be instrumented.
|
java.lang.String |
getIncludes() |
Returns the wildcard expression for classes to include.
|
boolean |
getJmx() |
Returns whether the agent exposes functionality via JMX.
|
AgentOptions.OutputMode |
getOutput() |
Returns the output mode
|
int |
getPort() |
Returns the port on which to listen to when the output is
tcpserver or the port to connect to when output is
tcpclient . |
java.lang.String |
getQuotedVMArgument(java.io.File agentJarFile) |
Generate required quoted JVM argument based on current configuration and
supplied agent jar location.
|
java.lang.String |
getSessionId() |
Returns the session identifier.
|
java.lang.String |
getVMArgument(java.io.File agentJarFile) |
Generate required JVM argument based on current configuration and
supplied agent jar location.
|
java.lang.String |
prependVMArguments(java.lang.String arguments,
java.io.File agentJarFile) |
Generate required quotes JVM argument based on current configuration and
prepends it to the given argument command line.
|
void |
setAddress(java.lang.String address) |
Sets the hostname or IP address to listen to when output is
tcpserver or connect to when output is
tcpclient |
void |
setAppend(boolean append) |
Sets whether the output should be appended to an existing file.
|
void |
setClassDumpDir(java.lang.String location) |
Sets the directory where class files should be dumped to.
|
void |
setDestfile(java.lang.String destfile) |
Sets the output file location.
|
void |
setDumpOnExit(boolean dumpOnExit) |
Sets whether coverage data should be dumped on exit.
|
void |
setExclClassloader(java.lang.String expression) |
Sets the wildcard expression for excluded class loaders.
|
void |
setExcludes(java.lang.String excludes) |
Sets the wildcard expression for classes to exclude.
|
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(java.lang.String includes) |
Sets the wildcard expression for classes to include.
|
void |
setJmx(boolean jmx) |
Sets whether the agent should expose functionality via JMX.
|
void |
setOutput(java.lang.String output) |
Sets the output mode
|
void |
setOutput(AgentOptions.OutputMode output) |
Sets the output mode
|
void |
setPort(int port) |
Sets the port on which to listen to when output is
tcpserver
or the port to connect to when output is tcpclient |
void |
setSessionId(java.lang.String id) |
Sets the session identifier.
|
java.lang.String |
toString() |
Creates a string representation that can be passed to the agent via the
command line.
|
public static final java.lang.String DESTFILE
jacoco.exec
in the working directory.public static final java.lang.String DEFAULT_DESTFILE
public static final java.lang.String APPEND
true
.public static final java.lang.String INCLUDES
*
(all classes included).WildcardMatcher
,
Constant Field Valuespublic static final java.lang.String EXCLUDES
WildcardMatcher
,
Constant Field Valuespublic static final java.lang.String EXCLCLASSLOADER
sun.reflect.DelegatingClassLoader
.WildcardMatcher
,
Constant Field Valuespublic static final java.lang.String INCLBOOTSTRAPCLASSES
false
.public static final java.lang.String INCLNOLOCATIONCLASSES
false
.public static final java.lang.String SESSIONID
public static final java.lang.String DUMPONEXIT
true
.public static final java.lang.String OUTPUT
AgentOptions.OutputMode.file
.public static final java.lang.String ADDRESS
DEFAULT_ADDRESS
.public static final java.lang.String DEFAULT_ADDRESS
public static final java.lang.String PORT
DEFAULT_PORT
.public static final int DEFAULT_PORT
public static final java.lang.String CLASSDUMPDIR
null
(no dumps).public static final java.lang.String JMX
false
.public AgentOptions()
public AgentOptions(java.lang.String optionstr)
optionstr
- string to parse or null
public AgentOptions(java.util.Properties properties)
Properties
object.properties
- Properties
object to read configuration options frompublic java.lang.String getDestfile()
public void setDestfile(java.lang.String destfile)
destfile
- output file locationpublic boolean getAppend()
true
, when the output should be appendedpublic void setAppend(boolean append)
append
- true
, when the output should be appendedpublic java.lang.String getIncludes()
WildcardMatcher
public void setIncludes(java.lang.String includes)
includes
- wildcard expression for classes to includeWildcardMatcher
public java.lang.String getExcludes()
WildcardMatcher
public void setExcludes(java.lang.String excludes)
excludes
- wildcard expression for classes to excludeWildcardMatcher
public java.lang.String getExclClassloader()
WildcardMatcher
public void setExclClassloader(java.lang.String expression)
expression
- expression for excluded class loadersWildcardMatcher
public boolean getInclBootstrapClasses()
true
if classes from the bootstrap classloader
should be instrumentedpublic void setInclBootstrapClasses(boolean include)
include
- true
if bootstrap classes should be instrumentedpublic boolean getInclNoLocationClasses()
true
if classes without source location should be
instrumentedpublic void setInclNoLocationClasses(boolean include)
include
- true
if classes without source location should be
instrumentedpublic java.lang.String getSessionId()
public void setSessionId(java.lang.String id)
id
- session identifierpublic boolean getDumpOnExit()
true
if coverage data will be written on VM exitpublic void setDumpOnExit(boolean dumpOnExit)
dumpOnExit
- true
if coverage data should be written on VM
exitpublic int getPort()
tcpserver
or the port to connect to when output is
tcpclient
.public void setPort(int port)
tcpserver
or the port to connect to when output is tcpclient
port
- port to listen on or connect topublic java.lang.String getAddress()
tcpserver
or connect to when output is
tcpclient
public void setAddress(java.lang.String address)
tcpserver
or connect to when output is
tcpclient
address
- Hostname or IP addresspublic AgentOptions.OutputMode getOutput()
public void setOutput(java.lang.String output)
output
- Output modepublic void setOutput(AgentOptions.OutputMode output)
output
- Output modepublic java.lang.String getClassDumpDir()
null
(no dumps)public void setClassDumpDir(java.lang.String location)
location
- dump location or null
(no dumps)public boolean getJmx()
true
, when JMX is enabledpublic void setJmx(boolean jmx)
jmx
- true
if JMX should be enabledpublic java.lang.String getVMArgument(java.io.File agentJarFile)
agentJarFile
- location of the JaCoCo Agent Jarpublic java.lang.String getQuotedVMArgument(java.io.File agentJarFile)
agentJarFile
- location of the JaCoCo Agent Jarpublic java.lang.String prependVMArguments(java.lang.String arguments, java.io.File agentJarFile)
arguments
- existing command line arguments or null
agentJarFile
- location of the JaCoCo Agent Jarpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018. All rights reserved.