Understanding the Code Example

This is an overview to help you understand the code example. The example assumes the existence of some unknown testing tool.

The Example Environment

There are two tests of some type known to the testing tool. Tests of this type are composed of units of code called TestActions. TestActions are maintained independently. A test can be composed of any number of TestActions. Tests can also use TestActions that belong to other tests.

In this example there are two such tests, QueryAvailability and IssueTicket. IssueTicket is composed two TestActions, Authenticate and LaunchJob. The Authenticate TestAction is also used by the QueryAvailability test. In addition, when running QueryAvailability, a resource file is needed. The resource is a run-time library.

The Setup Example

  1. Create two ALM Test objects to represent each of the testing tool tests.
  2. Create two ALM UserAsset objects to represent each of the TestActions of IssueTicket (Authenticate and LaunchJob).
  3. Create two ALM AssetRepositoryItem objects to represent each user asset's files.
  4. Upload the TestAction files to the asset repository items.
  5. Create a relation between test QueryAvailability and user asset Authenticate. Create the relation with no conditions because Authenticate is used whenever QueryAvailability is run or edited.
  6. Create the QCResource object for the run-time library and upload the file.
  7. Create a relation between QueryAvailability and the resource. Create the relation with the condition "RUN" because the resource is needed only when running QueryAvailability, and not when editing it.

The fact that the user assets represent TestActions to the testing tool is not passed to ALM. The fact that the resource is a run-time library is also not passed. ALM has no knowledge of the nature of the assets nor of the logical meaning of the relations.

Usage

After the setup is complete, the tests can be downloaded to edit or run.
When downloading for editing, pass "EDIT" as the Condition argument for the Download function. The result is:

  • When downloading test IssueTicket, all files linked to user assets Authenticate and LaunchJob are downloaded.
  • When downloading test QueryAvailability, only files linked to user asset Authenticate are downloaded.

The resource file is not downloaded for editing.

When downloading to run the tests, pass "RUN" as the Condition argument for the Download function. The result is:

  • When downloading test IssueTicket, all files linked to user assets Authenticate and LaunchJob are downloaded.
  • When downloading test QueryAvailability, the resource file and all files linked to user asset Authenticate are downloaded.

The download function returns an XML document describing the entities downloaded. Below is an example of such a document:

<Owners>
  <Owner>
      <OwnerId>25</OwnerId>
      <OwnerType>TEST</OwnerType>
      <Name><![CDATA[QueryAvailability&cd;></Name>
      <FSPath><![CDATA[Test\QueryAvailability_25\25\25&cd;></FSPath>
      <QCPath><![CDATA[Subject\newFolder1\QueryAvailability&cd;></QCPath>
      <Relation>
          <RelatedId>1025</RelatedId>
          <RelatedType>USER_ASSETS</RelatedType>
          <Name><![CDATA[Authenticate&cd;></Name>
          <FSPath><![CDATA[Test\IssueTicket_26\26\26&cd;></FSPath>
          <QCPath><![CDATA[Subject\newFolder1\IssueTicket&cd;></QCPath>
          <Condition>NONE</Condition>
          <Order>1</Order>
      </Relation>
      <Relation>
          <RelatedId>1009</RelatedId>
          <RelatedType>RESOURCES</RelatedType>
          <Name><![CDATA[Resource for running QueryAvailability&cd;></Name>
          <FSPath><![CDATA[resources\1009&cd;></FSPath>
          <QCPath><![CDATA[Resources\Resource for running QueryAvailability37&cd;></QCPath>
          <Condition>RUN</Condition>
          <Order>2</Order>
      </Relation>
  </Owner>
</Owners>

See the code example.