RQM 6.0.6.1 Unable to retrieve the Test Case title using OSLC
Hi Folks, we have some legacy OSLC code that is unable to retrieve the Test Case Title from RQM 6.0.6.1 using OSLC called from a RTC plugin:
String tcXPath = "//ns2:testcase/ns3:identifier";
xpath.setNamespaceContext(
new NamespaceContextMap(
new String[] { "ns2", "http://jazz.net/xmlns/alm/qm/v0.1/",
"ns3", "http://purl.org/dc/elements/1.1/" }));
InputSource source = new InputSource(response.getEntity().getContent());
Element tcNode = (Element)xpath.evaluate(tcXPath, source, XPathConstants.NODE);
if (tcNode == null)
{
response.getEntity().getContent().close();
logger.warn("Could not find Test Case URL in XML for test case " + tcId);
return null;
}
Element tcParent = (Element)tcNode.getParentNode();
Element tcNameNode = (Element)tcParent.getElementsByTagName("ns3:title").item(0);
if (tcNameNode == null) {
logger.warn("Could not find Test Case Name in XML for test case " + tcId);
} else {
this.testCaseName = tcNameNode.getTextContent();
}
I think the ns3 Tag is incorrect does anyone know what the right tag might be?
Accepted answer
Hi Russell,
Yes, the tag is ns4 for "http://purl.org/dc/elements/1.1/" is correct. It should work after changing the tag.
Thanks,
Monika Rajput