* validated when loaded.
*/
protected static TestSuite buildTestSuite(Element element,
TestSuite parent)
throws TestException {
DefaultTestSuite testSuite
= new DefaultTestSuite();
/* FIXX: Not used -- should we call testSuite.setName(suiteName)??? */
// String suiteName
// = element.getAttribute(XTS_NAME_ATTRIBUTE);
String suiteId
= element.getAttribute(XTS_ID_ATTRIBUTE);
testSuite.setId(suiteId);
NodeList children = element.getChildNodes();
if(children != null && children.getLength() > 0){
int n = children.getLength();
for(int i=0; i<n; i++){
Node child = children.item(i);
if(child.getNodeType() == Node.ELEMENT_NODE){
Element childElement = (Element)child;
String tagName = childElement.getTagName().intern();
// System.out.println("Processing child : " + tagName);
if(tagName == XTS_TEST_TAG){
Test t = buildTest(childElement);
testSuite.addTest(t);
}
else if(tagName == XTS_TEST_GROUP_TAG){
Test t = buildTestSuite(childElement, testSuite);
testSuite.addTest(t);
}
}
}
}