public class KoverRuntime
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOG_FILE_PROPERTY_NAME
JVM property name used to define the path to the file with Kover offline logs.
|
static java.lang.String |
REPORT_PROPERTY_NAME
JVM property name used to define the path where the offline report will be stored.
|
| Constructor and Description |
|---|
KoverRuntime() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<ClassCoverage> |
collect(java.util.List<byte[]> classFiles)
Get classes coverage.
|
static java.util.List<ClassCoverage> |
collectByDirs(java.util.List<java.io.File> classFileRoots)
Get classes coverage.
|
static byte[] |
getReport()
Get content of the coverage binary report with ic format.
|
static void |
saveReport(java.io.File file)
Save coverage binary report in file with ic format.
|
public static final java.lang.String REPORT_PROPERTY_NAME
If this property is specified, then at the end of the JVM process, the binary coverage report will be saved to a file at the path passed in the parameter value.
If the file does not exist, it will be created. If a file with that name already exists, it will be overwritten.
public static final java.lang.String LOG_FILE_PROPERTY_NAME
If this property is not specified, the logs file will not be created.
public static java.util.List<ClassCoverage> collectByDirs(java.util.List<java.io.File> classFileRoots)
Calling this method is allowed only after all tests are completed. If the method is called in parallel with the execution of the measured code, the coverage value is unpredictable.
classFileRoots - root directories containing non-instrumented class-files the coverage of which
needs to be measured.
The search for class-files is recursive.classFileRoots parameter.public static java.util.List<ClassCoverage> collect(java.util.List<byte[]> classFiles)
Calling this method is allowed only after all tests are completed. If the method is called in parallel with the execution of the measured code, the coverage value is unpredictable.
classFiles - a bytecode of non-instrumented application classes the coverage of which needs to be measured.classFiles parameter.public static void saveReport(java.io.File file)
throws java.io.IOException
Calling this method is allowed only after all tests are completed. If the method is called in parallel with the execution of the measured code, the coverage value is unpredictable.
file - the file to save binary reportjava.io.IOException - in case of any error working with filespublic static byte[] getReport()
throws java.io.IOException
Calling this method is allowed only after all tests are completed. If the method is called in parallel with the execution of the measured code, the coverage value is unpredictable.
java.io.IOException - in case of any error working with files