List<Element> parmChildren = queryElement.getChildren(TagNames.Elements.SQL);
if (parmChildren == null || parmChildren.isEmpty()) {
TestLogger.logDebug("======= Single QueryTest ");
QuerySQL sql = createQuerySQL(queryElement);
QueryTest q = new QueryTest(queryScenarioID, uniqueID, querySetID, new QuerySQL[] {sql}, false);
queries.add(q);
} else {
TestLogger.logDebug("======= QueryTest has multiple sql statements");
QuerySQL[] querysql = new QuerySQL[parmChildren.size()];
int c = 0;
final Iterator<Element> sqliter = parmChildren.iterator();
while ( sqliter.hasNext() ) {
final Element sqlElement = (Element) sqliter.next();
QuerySQL sql = createQuerySQL(sqlElement);
querysql[c] = sql;
c++;
}
QueryTest q = new QueryTest(queryScenarioID, uniqueID, querySetID, querysql, false);
queries.add(q);
}
// queryMap.put(queryName, query);
} else {
Element exceptionElement = queryElement.getChild(TagNames.Elements.EXCEPTION);
String exceptionType = exceptionElement.getChild(TagNames.Elements.CLASS).getTextTrim();
String uniqueID = querySetID + "_" + queryName;
QuerySQL sql = new QuerySQL(exceptionType, null);
QueryTest q = new QueryTest(queryScenarioID, uniqueID, querySetID, new QuerySQL[] {sql}, true);
queries.add(q);