Contains information about the execution of unit tests, including whether unit tests were completed successfully, code coverage results, and failures.
A RunTestsResult object has the following properties:
Name | Type | Description |
---|---|---|
codeCoverage | CodeCoverageResult[] |
An array of one or more CodeCoverageResult objects that contains the details of the code coverage for the specified unit tests. |
codeCoverageWarnings | CodeCoverageWarning[] |
An array of one or more code coverage warnings for the test run. The results include both the total number of lines that could have been executed, as well as the number, line, and column positions of code that was not executed. |
failures | RunTestFailure[] |
An array of one or more RunTestFailure objects that contain information about the unit test failures, if there are any. |
numFailures | int | |
numTestsRun | int | |
successes | RunTestSuccess[] |
An array of one or more RunTestSuccess objects that contain information about successes, if there are any. |
totalTime | double |
The total cumulative time spent running tests. This can be helpful for performance monitoring. |
The RunTestsResult object contains this object. It contains information about whether or not the compile of the specified Apex and run of the unit tests was successful.
A CodeCoverageResult object has the following properties:
Name | Type | Description |
---|---|---|
dmlInfo | CodeLocation[] |
For each class or trigger tested, for each portion of code tested, this property contains the DML statement locations, the number of times the code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
id | ID |
The ID of the CodeLocation. The ID is unique within an organization. |
locationsNotCovered | CodeLocation[] |
For each class or trigger tested, if any code is not covered, the line and column of the code not tested, and the number of times the code was executed. |
methodInfo | CodeLocation[] |
For each class or trigger tested, the method invocation locations, the number of times the code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
name | string | |
namespace | string |
The namespace that contained the unit tests, if one is specified. |
numLocations | int | |
soqlInfo | CodeLocation[] |
For each class or trigger tested, the location of SOQL statements in the code, the number of times this code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
soslInfo | CodeLocation[] |
For each class tested, the location of SOSL statements in the code, the number of times this code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
type | string |
Do not use. In early, unsupported releases, used to specify class or package. |
The RunTestsResult object contains this object. It contains information about the Apex class which generated warnings.
The RunTestsResult object returns information about failures during the unit test run.
This object has the following properties:
The RunTestsResult object returns information about successes during the unit test run.
This object has the following properties:
The RunTestsResult object contains this object in a number of fields.