public final class AgentOptions extends Object
key1=value1,key2=value2,key3=value3
Modifier and Type | Class and Description |
---|---|
static class |
AgentOptions.OutputMode
Possible values for
OUTPUT . |
Modifier and Type | Field and Description |
---|---|
static String |
ADDRESS
The IP address or DNS name the tcpserver binds to or the tcpclient
connects to.
|
static String |
APPEND
Specifies whether execution data should be appended to the output file.
|
static String |
CLASSDUMPDIR
Specifies where the agent dumps all class files it encounters.
|
static String |
DEFAULT_ADDRESS
Default value for the "address" agent option.
|
static int |
DEFAULT_PORT
Default value for the "port" agent option.
|
static String |
DESTFILE
Specifies the output file for execution data.
|
static String |
DUMPONEXIT
Specifies whether the agent will automatically dump coverage data on VM
exit.
|
static String |
EXCLCLASSLOADER
Wildcard expression for class loaders names for classes that should be
excluded from code coverage.
|
static String |
EXCLUDES
Wildcard expression for class names that should be excluded from code
coverage.
|
static String |
INCLUDES
Wildcard expression for class names that should be included for code
coverage.
|
static String |
OUTPUT
Specifies the output mode.
|
static String |
PORT
The port the tcpserver binds to or the tcpclient connects to.
|
static String |
SESSIONID
Specifies a session identifier that is written with the execution data.
|
Constructor and Description |
---|
AgentOptions()
New instance with all values set to default.
|
AgentOptions(String optionstr)
New instance parsed from the given option string.
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getClassDumpDir()
Returns the location of the directory where class files should be dumped
to.
|
String |
getDestfile()
Returns the output file location.
|
boolean |
getDumpOnExit()
Returns whether coverage data should be dumped on exit
|
String |
getExclClassloader()
Returns the wildcard expression for excluded class loaders.
|
String |
getExcludes()
Returns the wildcard expression for classes to exclude.
|
String |
getIncludes()
Returns the wildcard expression for classes to include.
|
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 . |
String |
getSessionId()
Returns the session identifier.
|
String |
getVMArgument(File agentJarFile)
Generate required JVM argument string based on current configuration and
supplied agent jar location
|
void |
setAddress(String address)
Sets the hostname or IP address to listen to when output is
tcpserver or connect to when output is |
void |
setAppend(boolean append)
Sets whether the output should be appended to an existing file.
|
void |
setClassDumpDir(String location)
Sets the directory where class files should be dumped to.
|
void |
setDestfile(String destfile)
Sets the output file location.
|
void |
setDumpOnExit(boolean dumpOnExit)
Sets whether coverage data should be dumped on exit
|
void |
setExclClassloader(String expression)
Sets the wildcard expression for excluded class loaders.
|
void |
setExcludes(String excludes)
Sets the wildcard expression for classes to exclude.
|
void |
setIncludes(String includes)
Sets the wildcard expression for classes to include.
|
void |
setOutput(AgentOptions.OutputMode output)
Sets the output mode
|
void |
setOutput(String 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(String id)
Sets the session identifier.
|
String |
toString()
Creates a string representation that can be passed to the agent via the
command line.
|
public static final String DESTFILE
jacoco.exec
in the working directory.public static final String APPEND
true
.public static final String INCLUDES
*
(all classes included).WildcardMatcher
,
Constant Field Valuespublic static final String EXCLUDES
WildcardMatcher
,
Constant Field Valuespublic static final String EXCLCLASSLOADER
sun.reflect.DelegatingClassLoader
.WildcardMatcher
,
Constant Field Valuespublic static final String SESSIONID
public static final String DUMPONEXIT
true
.public static final String OUTPUT
AgentOptions.OutputMode.file
.public static final String ADDRESS
DEFAULT_ADDRESS
.public static final String DEFAULT_ADDRESS
public static final String PORT
DEFAULT_PORT
.public static final int DEFAULT_PORT
public static final String CLASSDUMPDIR
null
(no dumps).public AgentOptions()
public AgentOptions(String optionstr)
optionstr
- string to parse or null
public String getDestfile()
public void setDestfile(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 String getIncludes()
WildcardMatcher
public void setIncludes(String includes)
includes
- wildcard expression for classes to includeWildcardMatcher
public String getExcludes()
WildcardMatcher
public void setExcludes(String excludes)
excludes
- wildcard expression for classes to excludeWildcardMatcher
public String getExclClassloader()
WildcardMatcher
public void setExclClassloader(String expression)
expression
- expression for excluded class loadersWildcardMatcher
public String getSessionId()
public void setSessionId(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
- public String getAddress()
tcpserver
or connect to when output is
tcpclient
public void setAddress(String address)
tcpserver or connect to when output is tcpclient
address
- Hostname or IP addresspublic AgentOptions.OutputMode getOutput()
public void setOutput(String output)
output
- Output modepublic void setOutput(AgentOptions.OutputMode output)
output
- Output modepublic String getClassDumpDir()
null
(no dumps)public void setClassDumpDir(String location)
location
- dump location or null
(no dumps)public String getVMArgument(File agentJarFile)
agentJarFile
- location of the JaCoCo Agent JarCopyright © 2012. All Rights Reserved.