|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jacoco.core.runtime.AgentOptions
public final class AgentOptions
Utility to create and parse options for the runtime agent. Options are represented as a string in the following format:
key1=value1,key2=value2,key3=value3
| Nested Class Summary | |
|---|---|
static class |
AgentOptions.OutputMode
Possible values for OUTPUT. |
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
AgentOptions()
New instance with all values set to default. |
|
AgentOptions(String optionstr)
New instance parsed from the given option string. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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.
AgentOptions.OutputMode.file,
AgentOptions.OutputMode.tcpserver,
AgentOptions.OutputMode.tcpclient,
Constant Field Valuespublic 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).
| Constructor Detail |
|---|
public AgentOptions()
public AgentOptions(String optionstr)
optionstr - string to parse or null| Method Detail |
|---|
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()
WildcardMatcherpublic void setIncludes(String includes)
includes - wildcard expression for classes to includeWildcardMatcherpublic String getExcludes()
WildcardMatcherpublic void setExcludes(String excludes)
excludes - wildcard expression for classes to excludeWildcardMatcherpublic String getExclClassloader()
WildcardMatcherpublic void setExclClassloader(String expression)
expression - expression for excluded class loadersWildcardMatcherpublic 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
- Parameters:
address - Hostname or IP address
public 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 Jar
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||