Newer Version Available
RunTestsRequest
Specifies information about the Apex code to be tested. RunTestsRequest is part of CompileAndTestRequest, which is the request passed to the compileAndTest() call. This object is also passed to the Tooling SOAP API call runTests(). You can specify the same or different classes to be tested and compiled. Since triggers cannot be tested directly, they are not included in this object. Instead, you must specify a class that calls the trigger.
If the request is sent to a production organization, this request is ignored and all unit tests defined for your organization are run.
The RunTestsRequest object has the following properties:
| Name | Type | Description |
|---|---|---|
| allTests | boolean* | If allTests is true, all unit tests defined for your organization are run. |
| classes | string*[] | An array of one or more objects. |
| namespace | string | If specified, the namespace that contains the unit tests to be run. Do not use this property if you specify allTests as true. Also, if you execute compileAndTest() in a production organization, this property is ignored, and all unit tests defined for the organization are run. |
| maxFailedTests | int | A mandatory parameter for the Tooling SOAP API call runTests(). To allow all tests in a run to execute, set maxFailedTests to -1. To stop the test run from executing new tests after a given number of tests fail, set maxFailedTests to an integer value from 0 to 1,000,000. This integer value sets the maximum allowable test failures. A value of 0 causes the test run to stop if any failure occurs. A value of 1 causes the test run to stop on the second failure, and so on. |
| packages | string*[] | Do not use after version 10.0. For earlier, unsupported releases, the content of the package to be tested. |
| tests | TestsNode[] |
A mandatory parameter for the Tooling SOAP API call runTests(). Specifies individual test methods in an Apex test class. To specify classes or suites instead of a TestsNode[], set tests to null. Although this property accepts an array, the array can contain only one entry. |
TestsNode
Specifies individual test methods in an Apex test class.
| Name | Type | Description |
|---|---|---|
| classId | string |
|
| className | string |
|
| testMethods | string*[] |
|
* Link goes to the SOAP API Developer's Guide.