Main Content

oslc.qm.TestResult

Test result resource for OSLC quality management domain

Since R2021a

    Description

    The oslc.qm.TestResult object represents test result 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 result resources by using the queryTestResults function.

    Creation

    Create an oslc.qm.TestResult by using the createTestResult function.

    Properties

    expand all

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

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

    • 1 indicates the test result resource has uncommitted changes.

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

    Data Types: logical

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

    • 1 indicates the test result resource is fetched.

    • 0 indicates the test result resource is not fetched.

    Data Types: logical

    Test result title, specified as a character array.

    OSLC test result resource identifier, specified as a character array.

    Object Functions

    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
    getProducedTestExecutionRecordGet locally stored test execution record traceability link from Open Services for Lifecycle Collaboration (OSLC) test result resource object
    getPropertyGet local contents of text property from OSLC resource object
    getRDFGet resource RDF/XML data from OSLC resource object
    getReportsOnTestCaseGet locally stored test case traceability link from OSLC test result resource object
    getResourcePropertyGet local contents of resource property from OSLC resource object
    getStatusGet locally stored status from OSLC test result resource object
    removeRemove resource from OSLC service provider
    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 result resources with a configured OSLC client, edit an existing test result 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 result resource type.

    myQueryCapability = getQueryService(myClient,'TestResult');

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

    testResults = queryTestResults(myQueryCapability)
    testResults = 
    
      1×2 TestResult array with properties:
    
        ResourceUrl
        Dirty
        IsFetched
        Title
        Identifier

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

    myTestResult = testResults(1);
    status = fetch(myTestResult,myClient)
    status = 
    
      StatusCode enumeration
    
        OK
    title = myTestResult.Title
    title =
    
        'Test Case 1'
    

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

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

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

    show(myTestResult)

    This example shows how to submit a creation request for a new test result 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 result resource type.

    myCreationFactory = getCreationFactory(myClient,'TestResult');

    Use the creation factory to create a test result resource with the title My New Test Result and associate it with the test case resource URL specified by testURL and the test execution record resource URL specified by executionURL. Set the test result status to Unverified. For more information about querying the service provider for test cases and execution records, see Edit a Test Case and Commit Changes and Edit a Test Execution Record and Commit Changes. Retrieve the full resource data from the service provider for the test result resource and inspect the resource.

    newTestResult = createTestResult(myCreationFactory, ...
        'My New Test Result',testURL,executionURL,'Unverified');
    fetch(newTestCase,myClient);
    newTestResult
    newTestResult = 
      TestResult with properties:
    
        ResourceUrl: 'https://localhost:9443/qm/oslc_qm/resources/CdffuW...'
              Dirty: 0
          IsFetched: 1
              Title: 'My New Test Result'
         Identifier: '1456'
    

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

    show(newTestResult)

    Version History

    Introduced in R2021a