ApexTestQueueItem

Note
The API for asynchronous test runs is a Beta release.

Represents a single Apex class in the Apex job queue. This object is available in API version 23.0 and later.

Supported Calls

create(), describeSObjects(), query(), retrieve(), update(), upsert()

Fields

Field Name Description
ApexClassId
Type
reference
Properties
Create, Filter, Group, Sort
Description

The Apex class whose tests are to be executed.

This field can't be updated.

ExtendedStatus
Type
string
Properties
Filter, Nillable, Sort
Description

The pass rate of the test run.

For example: “(4/6)”. This means that four out of a total of six tests passed.

If the class fails to execute, this field contains the cause of the failure.

ParentJobId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description

Read-only. Points to the AsyncApexJob that represents the entire test run.

If you insert multiple Apex test queue items in a single bulk operation, the queue items will share the same parent job. This means that a test run can consist of the execution of the tests of several classes if all the test queue items are inserted in the same bulk operation.

Status
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort, Update
Description
The status of the job. Valid values are:
  • Holding1
  • Queued
  • Preparing
  • Processing
  • Aborted
  • Completed
  • Failed
1 This status is for the Apex Flex Queue pilot.

Usage

Insert an ApexTestQueueItem object to place its corresponding Apex class in the Apex job queue for execution. The Apex job executes the test methods in the class.

To abort a class that is in the Apex job queue, perform an update operation on the ApexTestQueueItem object and set its Status field to Aborted.

If you insert multiple Apex test queue items in a single bulk operation, the queue items will share the same parent job. This means that a test run can consist of the execution of the tests of several classes if all the test queue items are inserted in the same bulk operation.
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.