Main Content

oslc.qm.TestCase

Test case resource for OSLC quality management domain

    Description

    Theoslc.qm.TestCaseobject represents test case resources in the quality management domain of the Open Services for Lifecycle Collaboration (OSLC) service provider. After creating and configuringoslc.Clientandoslc.core.QueryCapabilityobjects, query the service provider for available test case resources with thequeryTestCasesfunction.

    Creation

    Create anoslc.qm.TestCaseobject by using thecreateTestCasefunction.

    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 logical1or0where:

    • 1indicates the test case resource has uncommitted changes.

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

    Data Types:logical

    test case resource fetch status, specified as a logical1or0where:

    • 1indicates the test case resource is fetched.

    • 0indicates 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

    addRequirementLink Add requirement traceability link to local OSLC test resource object
    addResourceProperty Add resource property to local OSLC resource object
    addTextProperty Add text property to local OSLC resource object
    commit Send local changes to OSLC service provider
    fetch Retrieve full resource data from OSLC service provider
    getProperty Get local contents of text property from OSLC resource object
    getRDF Get resource RDF/XML data from OSLC resource object
    getRequirementLinks Get locally stored requirement traceability links from OSLC test resource object
    getResourceProperty Get local contents of resource property from OSLC resource object
    remove Remove resource from OSLC service provider
    removeRequirementLink Remove requirement traceability link from local OSLC test resource object
    removeResourceProperty Remove resource property from local OSLC resource object
    setProperty Set local contents of text property for OSLC resource object
    setRDF Set RDF content for local OSLC resource object
    setResourceUrl Set resource URL for local OSLC resource object
    show View 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 clientmyClient中描述的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 variablemyTestCase。检索资源的数据服务provider for the test case resource. Examine theTitleproperty.

    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 theshowfunction.

    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 clientmyClient中描述的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 titleMy New Test Case。检索资源的数据服务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 theshowfunction.

    show(newTestCase)

    Version History

    Introduced in R2021a