Hi,
Based on the ETMSample
from Lyo’s OSLC-client 4.0.0 lyo-samples/ETMSample.java at master · OSLC/lyo-samples (github.com), I wrote a query that should retrieve all the test cases of a given project area.
The result of this query is always an empty array, although there is actually 3 test cases in this project area.
Did I missed something ?
String catalogUrl = new RootServicesHelper(
<QM URL>
, OSLCConstants.OSLC_QM_V2, client).getCatalogUrl();
String serviceProviderUrl = client.lookupServiceProviderUrl(catalogUrl,<QM project area>
);
String queryCapability = client.lookupQueryCapability(serviceProviderUrl, OSLCConstants.OSLC_QM_V2, OSLCConstants.QM_TEST_CASE_QUERY);
OslcQueryParameters queryParams = new OslcQueryParameters();
queryParams.setPrefix(“rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#”);
queryParams.setWhere(“rdf:type=http://open-services.net/ns/qm#TestCase”);
OslcQuery query = new OslcQuery(client, queryCapability, -1, queryParams);
OslcQueryResult result = query.submit();
Assertions.assertNotNull(result);
Assertions.assertEquals(3, result.getMembersUrls().length);
The corresponding request that is actually generated is :
https:///qm/oslc_qm/contexts/_kMlv4BoCEey2zPn1rSWp-Q/resources/com.ibm.rqm.planning.VersionedTestCase?oslc.where=rdf%3Atype%3D%3Chttp%3A%2F%2Fopen-services.net%2Fns%2Fqm%23TestCase%3E&oslc.prefix=rdf%3D%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E
The resulting status is “200 / OK” but the returned array is empty.