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
Russell Norlund selected this answer as the correct answer
Comments
Russell Norlund
commented Dec 09 '20, 10:03 a.m.
Thanks for the confirmation Monika
Russell Norlund
commented Dec 09 '20, 11:58 a.m.
Just to confirm the lines that need to change are:
and
getElementsByTagName("ns3:title"). to getElementsByTagName("ns4:title"). |
One other answer
The tag as changed from ns3 to ns4 in 6.0.6.1 |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.