Merge several Emma coverage data files into one.
Task package: | com.vladium.emma |
Java package: | |api:package-summary:?linkClass=| |
Category: | Analyzing tasks |
Since: | 0.5 |
EntityFS-aware? | No* |
Implements: | GeneratorTaskFactory |
See also: | EmmaInstrumentationTF EmmaReportTF |
Description:
Merge several Emma coverage data
files into one. The files are merged by running Emma's emma
command
in a forked process.
If the number of files to merge is large, this task launches several, consecutive, partial merge operations and then merge their results. The definition of large is the maxNoOfFilesInOneMerge property.
For more information on the different properties, see the Emma Reference Manual.
The following strategy is used for searching for the java
command to use:
- Use a Java executable suggested by an ExtJavaTaskDecorator, if any
- Use the
javaExecutable
property, if set - Use the file
bin/java[.exe]
relative to thejavaHome
property, if set - Use the file
bin/java[.exe]
relative to theJAVA_HOME
environment variable, if set - Search for
java[.exe]
in the paths listed in thePATH
environment variable
Required properties
Properties
assertions | top |
Are assertions enabled? More fine-grained assertion settings can be set by setting JVM options.
- Setter method:
setAssertions(boolean b)
parameters:b
– Should assertions be enabled?- Default value:
false
(assertions are not enabled).- See also:
- jvmOptions
coverageDataFiles (required) | top |
A list of Emma coverage data files (usually ending in
.ec
) to merge.
- Setter method:
addCoverageDataFile(Object o)
Add one coverage data file.parameters:- Setter method:
addCoverageDataFiles(Collection<?> c)
Add a collection of coverage data files.parameters:c
– A collection of coverage data files.
Interpreted byArgumentInterpreter.getFile(java.lang.Object)
.- Setter method:
clearCoverageDataFiles()
Clear the list of coverage data files.
decorators | top |
A list of ExtJavaTaskDecorator:s. Decorators are used to configure the program to run.
- Setter method:
addDecorator(ExtJavaTaskDecorator d)
Add a decorator to the end of the list.parameters:d
– A Java task decorator- Setter method:
addDecorators(Collection<? extends ExtJavaTaskDecorator> c)
Add a collection of decorators. The decorators are added to the list in the order that they are returned from the collection.parameters:c
– A collection of decorators.
javaExecutable | top |
The path to the java[.exe]
command.
Decorators may also set the Java executable to use. In
that case, that setting take precedence.
- Setter method:
setJavaExecutable(Object o)
parameters:o
– The path to thejava[.exe]
command.
Interpreted byArgumentInterpreter.getFile(java.lang.Object)
.- Default value:
- The Java executable to use is, in this order of precedence:
- A Java executable set by any of the
decorators
. - This property.
- A Java executable found in the catalog referenced by the
javaHome
property, if set. - A Java executable found in the catalog referenced by the
JAVA_HOME
environment variable, if set. - A Java executable found in the directories referenced by the
PATH
environment variable.
- A Java executable set by any of the
- See also:
- javaHome
javaHome | top |
The location of the Java Runtime Environment or Java Development Kit to use
- Setter method:
setJavaHome(Object o)
parameters:- See also:
- javaExecutable
javaVMType | top |
The Java virtual machine type to use (client or server).
- Setter method:
setJavaVMType(JavaVMType t)
parameters:t
– The virtual machine type:JavaVMType.CLIENT
JavaVMType.SERVER
- Default value:
- The JRE:s default virtual machine type, probably client.
jvmOptions | top |
Options for the java
command. Options are
arguments to java
given before the class to run, see the JDK
documentation on java
.
- Setter method:
addJvmOption(String s)
parameters:s
– Add an option- Setter method:
addJvmOptions(Collection<String> c)
parameters:c
– Add a collection of options. The options are added in the order that they are returned from the collection.
logFooter | top |
The message that is logged to info
level
after the task has been successfully run.
- Setter method:
setLogFooter(String s)
parameters:s
– The footer message.- Default value:
- Empty (no footer message is logged.)
- See also:
- logHeader
logHeader | top |
The message that is logged to info
level
before the task is run.
- Setter method:
setLogHeader(String s)
parameters:s
– The header message.- Default value:
- A task class specific message.
- See also:
- logFooter
maxNoOfFilesInOneMerge | top |
The maximum total number of files (metadata + coverage) in one merge operation. If the total number of files to merge is greater than this number, the merge operation is split internally into several partial merges.
This is used so that the Emma command line will not be longer than the platform's maximum length (usually 65535 characters).
- Setter method:
setMaxNoOfFilesInOneMerge(int n)
parameters:n
– The maximum number of files.- Default value:
- 100
metadataFiles (required) | top |
A list of Emma metadata files (usually ending in
.em
) to merge.
- Setter method:
addMetadataFile(Object o)
Add one metadata file.parameters:- Setter method:
addMetadataFiles(Collection<?> c)
Add a collection of metadata files.parameters:c
– A collection of metadata files.- Setter method:
clearMetadataFiles()
Clear the list of metadata files.
overwriteStrategy | top |
The overwrite strategy decides how the task will react if there already is an entity (file or directory) in a location where it wants to create a new entity.
If the strategy is to not overwrite existing entities, the task will fail when it cannot create the entities that it wants to create.
Non-empty directories are never overwritten, regardless of the chosen strategy.
- Setter method:
setOverwrite(boolean b)
Setting this to a value ofparameters:true
means that the DoOverwriteAndLogWarning strategy is used. A value of false gives the DontOverwriteAndThrowException strategy.b
– Should an existing entity be overwritten?- Setter method:
setOverwriteStrategy(OverwriteStrategy strat)
Set the overwrite strategy.parameters:strat
– The overwrite strategy.- Default value:
- DontOverwriteAndThrowException
- See also:
- target
reportLevel | top |
This property is used to change the Report level for all task created by this task factory. The report level is changed for the thread running the task when the it is run, and is restored to its previous level when the it is done.
- Setter method:
setReportLevel(Level l)
Set the report levelparameters:l
– The new report level.
target (required) | top |
The target file for the merged data.
- Setter method:
setTarget(Object o)
parameters:
traceLogging | top |
If trace logging is enabled for a task, it reports its configuration before it is run.
Trace logging may also be enabled globally for all tasks by calling TraceMode.setTraceMode(boolean).
- Setter method:
setTraceLogging(boolean b)
Enable or disable trace logging.parameters:b
– Enable trace logging?
Examples
See this |tf:EmmaInstrumentationTF| example.* That a task is not EntityFS-aware means that it is not aware of DirectoryView filters (it uses them as plain Directory:s) and also that it usually requires that the entities it takes as arguments are in a File-based file file system. (That they are ECFileResolvable.) A non File-resolvable entity can be made so by using the SchmantFileSystems.makeFileResolvable(org.entityfs.EFile) method.