48 const QString & namespaceURI,
const QString & localname,
const QString & qname,
const QXmlAttributes & attrs)
52 std::string name=getName(localname,qname);
56 LDEBUG <<
"TestCasesHandler::startElement: new testcase ";
58 currentTestCase.
id=attributeValue(
"id", attrs);
59 std::string typech=attributeValue(
"type", attrs);
60 currentTestCase.
type=(typech.empty()?
"undefined":typech);
61 LDEBUG <<
"TestCasesHandler::startElement: id=" << currentTestCase.
id
62 <<
", type=" << currentTestCase.
type;
63 }
else if (name==
"text") {
65 LDEBUG <<
"TestCasesHandler::startElement: start text ";
67 }
else if (name==
"expl") {
68 LDEBUG <<
"TestCasesHandler::startElement: start expl ";
70 }
else if (name==
"call-parameters") {
72 LDEBUG <<
"TestCasesHandler::startElement: start call-parameters ";
73 }
else if (name==
"list") {
74 LDEBUG <<
"TestCasesHandler::startElement: start list ";
75 m_listKey = attributeValue(
"key", attrs);
79 std::pair<std::string,std::list<std::string> > newElem(m_listKey,std::list<std::string>() );
86 }
else if (name==
"map") {
87 LDEBUG <<
"TestCasesHandler::startElement: start map ";
88 m_mapKey = attributeValue(
"key",attrs);
89 MapValCallParams::iterator pos = currentTestCase.
mapValCallParams.find(m_mapKey);
92 std::pair<std::string,std::map<std::string,std::string> > newElem(m_mapKey,std::map<std::string,std::string>() );
99 }
else if (name==
"item") {
100 LDEBUG <<
"TestCasesHandler::startElement: start item ";
101 if( m_inList ==
true ) {
102 MultiValCallParams::iterator pos = currentTestCase.
multiValCallParams.find(m_listKey);
104 std::string val = attributeValue(
"value", attrs);
105 (*pos).second.push_back(val);
108 LERROR <<
"!! TestCasesHandler::startElement: no list for param " << m_listKey;
111 else if (m_inMap ==
true) {
112 MapValCallParams::iterator pos = currentTestCase.
mapValCallParams.find(m_mapKey);
114 std::string attr = attributeValue(
"key", attrs);
115 std::string val = attributeValue(
"value",attrs);
116 (*pos).second.insert(make_pair(attr,val));
119 LERROR <<
"!! TestCasesHandler::startElement: no list for param " << m_listKey;
123 }
else if (name==
"param") {
124 LDEBUG <<
"TestCasesHandler::startElement: start param ";
125 std::string key = attributeValue(
"key",attrs);
126 std::string val = attributeValue(
"value", attrs);
130 }
else if (name==
"test") {
134 tu.
id=attributeValue(
"id", attrs);
135 tu.
trace=attributeValue(
"trace", attrs);
136 tu.
comment=attributeValue(
"comment", attrs);
137 tu.
left=attributeValue(
"left", attrs);
138 tu.
op=attributeValue(
"operator", attrs);
139 tu.
right=attributeValue(
"right",attrs);
140 tu.
conditional=(attributeValue(
"conditional",attrs)==
"yes");
141 currentTestCase.
tests.push_back(tu);
142 LDEBUG <<
"TestCasesHandler::startElement: push testUnit"
144 <<
", trace =" << tu.
trace
146 <<
", left =" << tu.
left
148 <<
", right =" << tu.
right
158 currentTestCase.
explanation.append(chars.toUtf8().data());
159 }
else if (m_inText) {
161 std::string newTextVal(chars.toUtf8().data());
166 currentTestCase.
simpleValCallParams.insert(std::pair<std::string, std::string>(
"text",newTextVal) );
169 std::string& textVal = (*pos).second;
170 textVal.append(chars.toUtf8().data());