RunTestsRequest

Specifies information about the Apex code to be tested. RunTestsRequest is part of CompileAndTestRequest, which is the request passed to the compileAndTest() call. 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.
packages string*[] Do not use after version 10.0. For earlier, unsupported releases, the content of the package to be tested.

* Link goes to the SOAP API Developer's Guide.

Previous
Next