提交 4129ac50 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-6545] support nested test suites

上级 260f8f28
......@@ -68,6 +68,9 @@ Upcoming changes</a>
<li class=rfe>
Performance: Specify image sizes for faster page loading
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9182">issue 9182</a>)
<li class=rfe>
Support nested testsuites in the JUnit test result
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-6545">issue 6545</a>)
<li class=rfe>
Added an extension point to allow associating custom properties with views.
<li class=rfe>
......
......@@ -101,18 +101,21 @@ public final class SuiteResult implements Serializable {
Document result = saxReader.read(xmlReport);
Element root = result.getRootElement();
if(root.getName().equals("testsuites")) {
// multi-suite file
for (Element suite : (List<Element>)root.elements("testsuite"))
r.add(new SuiteResult(xmlReport, suite, keepLongStdio));
} else {
// single suite file
r.add(new SuiteResult(xmlReport, root, keepLongStdio));
}
parseSuite(xmlReport,keepLongStdio,r,root);
return r;
}
private static void parseSuite(File xmlReport, boolean keepLongStdio, List<SuiteResult> r, Element root) throws DocumentException, IOException {
// nested test suites
for (Element suite : (List<Element>)root.elements("testsuite"))
parseSuite(xmlReport, keepLongStdio, r, suite);
// child test cases
if (root.element("testcase")!=null)
r.add(new SuiteResult(xmlReport, root, keepLongStdio));
}
/**
* @param xmlReport
* A JUnit XML report file whose top level element is 'testsuite'.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册