Main Content

createTestResult

Create test result in OSLC service provider

Since R2021a

    Description

    example

    myTR = createTestResult(myCF,title,executionURL,testURL,status) creates a test result with the specified title for the test execution record and test case specified by the resource URLs executionURL and testURL, respectively. The resource result status is specified by status. The resource is created by using the creation factory myCF in the Open Services for Lifecycle Collaboration (OSLC) service provider.

    Examples

    collapse all

    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)

    Input Arguments

    collapse all

    OSLC resource creation factory, specified as an oslc.core.CreationFactory object.

    Test result title, specified as a character array.

    Resource URL of the test execution record to associate with the test result, specified as a character array.

    Resource URL of the test case to associate with the test result, specified as a character array.

    Test result status, specified as a character array.

    Output Arguments

    collapse all

    OSLC test result resource, returned as an oslc.qm.TestResult object.

    Version History

    Introduced in R2021a