rest ct: Fix bug in checking for bundle providing service
The DOM API usage incorrectly included usingBundles information.
@@ -1063,9 +1063,16 @@ public class RestServiceXMLTestCase extends RestTestUtils {
private String getTextValue(Element ele, String tagName) {
String textVal = null;
NodeList nl = ele.getElementsByTagName(tagName);
- if (nl != null && nl.getLength() > 0) {
- Element el = (Element)nl.item(0);
- textVal = el.getFirstChild().getNodeValue();
+ if (nl == null) {
+ return textVal;
+ }
+ int len = nl.getLength();
+ for (int i = 0; i < len; i++) {
+ Element el = (Element) nl.item(i);
+ if (ele.isSameNode(el.getParentNode())) {
+ textVal = getTextValue(el);
+ break;
+ }
}
return textVal;
