Main Content

oslc.qm.TestCase

Test case resource for OSLC quality management domain

Since R2021a

    Description

    The oslc.qm.TestCase object represents test case 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 case resources with the queryTestCases function.

    Creation

    Create an oslc.qm.TestCase object by using the createTestCase function.

    Properties

    expand all

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

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

    • 1 indicates the test case resource has uncommitted changes.

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

    Data Types: logical

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

    • 1 indicates the test case resource is fetched.

    • 0 indicates the test case resource is not fetched.

    Data Types: logical

    Test case title, specified as a character array.

    OSLC test case 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 case resources with a configured OSLC client, edit an existing test case 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 case resource type.

    myQueryCapability = getQueryService(myClient,'TestCase');

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

    testCases = queryTestCases(myQueryCapability)
    testCases = 
    
      1×4 TestCase array with properties:
    
        ResourceUrl
        Dirty
        IsFetched
        Title
        Identifier

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

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

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

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

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

    show(myTestCase)

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

    myCreationFactory = getCreationFactory(myClient,'TestCase');

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

    newTestCase = createTestCase(myCreationFactory,'My New Test Case');
    fetch(newTestCase,myClient);
    newTestCase
    newTestCase = 
      TestCase with properties:
    
        ResourceUrl: 'https://localhost:9443/qm/resource/itemName/_a9aS...'
              Dirty: 0
          IsFetched: 1
              Title: 'My New Test Case'
         Identifier: '301'

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

    show(newTestCase)

    Version History

    Introduced in R2021a