export tests: skip empty suites (due to successful configs) on export (IDEA-142269)

This commit is contained in:
Anna Kozlova
2015-07-06 16:23:53 +03:00
parent f068cf1448
commit a2a9ed2990

View File

@@ -206,9 +206,11 @@ public class TestResultsXmlFormatter {
if (node.isConfig()) {
attrs.put(ATTR_CONFIG, "true");
}
boolean started = false;
String elemName = node.isLeaf() ? ELEM_TEST : ELEM_SUITE;
startElement(elemName, attrs);
if (node.isLeaf()) {
started = true;
startElement(elemName, attrs);
final StringBuilder buffer = new StringBuilder();
final Ref<ConsoleViewContentType> lastType = new Ref<ConsoleViewContentType>();
final Ref<SAXException> error = new Ref<SAXException>();
@@ -255,10 +257,16 @@ public class TestResultsXmlFormatter {
//ignore configurations during export
continue;
}
if (!started) {
started = true;
startElement(elemName, attrs);
}
processNode(child, filter);
}
}
endElement(elemName);
if (started) {
endElement(elemName);
}
}
private void writeOutput(ConsoleViewContentType type, StringBuilder text, Filter filter) throws SAXException {