Reading Test Case id from Test Result using OSLC

Hi,
I am able to create TestResult object and retrive the values from it as
TestResult testResult= response.getEntity(TestResult.class);
testResult.getTitle() and so on ...
Now i need to get the Test Case Dd from it which is not happening. From rest client i am able to view the ID in Short Identifier tag as :
<oslc_qm:TestResult rdf:about="https://rb-alm...................>
<oslc:shortId rdf:datatype="http://www.w3.org/2001/XMLSchema#int">7292</oslc:shortId>
</oslc_qm:TestResult rdf:about="https://rb-alm...................>
but testResult.getShortIdentifier() method is not visible.
Is this method not exposed through OSLC.
Please let me know. If not then how do we read the TC IDs.
Thanks
Vaibhav
2 answers

Hi,
I used following code block for the same. it works fine:
response = client.getResource(resultsUrl[i], OSLCConstants.CT_RDF);
ClientResponse tempResponseVar2 = clientTestCase.getResource(resultsUrl[i], OSLCConstants.CT_RDF);
InputStream inputStream = response.getEntity(InputStream.class);
testCase= tempResponseVar2.getEntity(TestCase.class);
InputSource inputSource = new InputSource(inputStream);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document document = dBuilder.parse(inputSource);
NodeList element = document.getElementsByTagName("rqm_qm:shortIdentifier");
String testCaseId = null ;
for (int p = 0; p < element.getLength(); p++) {
System.out.println("Short Identifier Value is : " + element.item(p).getTextContent());
testCaseId = element.item(p).getTextContent();
}
response.consumeContent();
Thanks
Vaibhav

A simple OSLC based GET on Test case would return a Test Case Shape. ( you can get a sample OSLC XML from following link - http://open-services.net/bin/view/Main/QmSpecificationV2Samples or http://open-services.net/bin/view/Main/QmSpecificationV2Shapes).
I believe you may have been using some sort of ready to use SDk to perform these OSLC operation. Are you using Eclipse LYO?
Abhishek