Main Content

oslc.qm.TestScript

Test script resource for OSLC quality management domain

Since R2021a

    Description

    The oslc.qm.TestScript object represents test script resources in the quality management domain of the Open Services for Lifecycle Collaboration (OSLC) service provider. After creating and configuring oslc.Client and oslc.core.QueryCapability objects, query the service provider for available test script resources by using the queryTestScripts function.

    Creation

    Create an oslc.qm.TestScript object by using the createTestScript function.

    Properties

    expand all

    Navigation URL for the test script resource, specified as a character array.

    Indicator for uncommitted changes to the test script resource, specified as a logical 1or 0 where:

    • 1 indicates the test script resource has uncommitted changes.

    • 0 indicates the test script resource has no uncommitted changes.

    Data Types: logical

    test script resource fetch status, specified as a logical 1 or 0 where:

    • 1 indicates the test script resource is fetched.

    • 0 indicates the test script resource is not fetched.

    Data Types: logical

    Test script title, specified as a character array.

    Test script resource identifier, specified as a character array.

    Object Functions

    addRequirementLinkAdd requirement traceability link to local OSLC test resource object
    addResourcePropertyAdd resource property to local OSLC resource object
    addTextPropertyAdd text property to local OSLC resource object
    commitSend local changes to OSLC service provider
    fetchRetrieve full resource data from OSLC service provider
    getPropertyGet local contents of text property from OSLC resource object
    getRDFGet resource RDF/XML data from OSLC resource object
    getRequirementLinksGet locally stored requirement traceability links from OSLC test resource object
    getResourcePropertyGet local contents of resource property from OSLC resource object
    removeRemove resource from OSLC service provider
    removeRequirementLinkRemove requirement traceability link from local OSLC test resource object
    removeResourcePropertyRemove resource property from local OSLC resource object
    setPropertySet local contents of text property for OSLC resource object
    setRDFSet RDF content for local OSLC resource object
    setResourcePropertySet local contents of resource property from OSLC resource object
    setResourceUrlSet resource URL for local OSLC resource object
    showView OSLC resource in system browser

    Examples

    collapse all

    This example shows how to submit a query request for test script resources with a configured OSLC client, edit an existing test script resource, and commit the changes to the service provider.

    After you have created and configured the OSLC client myClient as described in Create and Configure an OSLC Client for the Quality Management Domain, create a query capability for the test script resource type.

    myQueryCapability = getQueryService(myClient,'TestScript');

    Submit a query request to the service provider for the available test script resources.

    testScripts = queryTestScripts(myQueryCapability)
    testScripts = 
    
      1×7 TestScript array with properties:
    
        ResourceUrl
        Dirty
        IsFetched
        Title
        Identifier

    Assign a test script resource to the variable myTestScript. Retrieve the full resource data from the service provider for the test script resource. Examine the Title property.

    myTestScript = testScripts(1);
    status = fetch(myTestScript,myClient)
    status = 
    
      StatusCode enumeration
    
        OK
    title = myTestScript.Title
    title =
    
        'Test Script 1'
    

    Edit the test script title and commit the change to the service provider.

    myTestScript.Title = 'My New Test Script Title';
    status = commit(myTestScript,myClient)
    status = 
    
      StatusCode enumeration
    
        OK

    Open the test script resource in the system browser by using the show function.

    show(myTestScript)

    This example shows how to submit a creation request for a new test script resource with a configured OSLC client.

    After you have created and configured the OSLC client myClient as described in Create and Configure an OSLC Client for the Quality Management Domain, create a creation factory for the test script resource type.

    myCreationFactory = getCreationFactory(myClient,'TestScript');

    Use the creation factory to create a test script resource with the creation factory with the title My New Test Script. Retrieve the full resource data from the service provider for the test script resource and inspect the resource.

    newTestScript = createTestScript(myCreationFactory, ...
        'My New Test Script');
    fetch(newTestScript,myClient);
    newTestScript
    newTestScript = 
      TestScript with properties:
    
        ResourceUrl: 'https://localhost:9443/qm/resource/itemName/_b19w2...'
              Dirty: 0
          IsFetched: 1
              Title: 'My New Test Script'
         Identifier: '498'

    Open the test script resource in the system browser by using the show function.

    show(newTestScript)

    Version History

    Introduced in R2021a