It's all about the answers!

Ask a question

RQM 6.0.6.1 Unable to retrieve the Test Case title using OSLC


Russell Norlund (17211621) | asked Dec 08 '20, 10:58 a.m.

 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(



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


permanent link
Monika Rajput (1962) | answered Dec 09 '20, 8:03 a.m.

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



permanent link
Russell Norlund (17211621) | answered Dec 09 '20, 12:20 a.m.

 The tag as changed from ns3 to ns4 in 6.0.6.1

Your answer


Register or to post your answer.