use of org.codehaus.staxmate.in.ElementFilter in project sonar-java by SonarSource.
the class SurefireStaxHandler method stream.
public void stream(SMHierarchicCursor rootCursor) throws XMLStreamException {
SMInputCursor testSuite = rootCursor.constructDescendantCursor(new ElementFilter("testsuite"));
SMEvent testSuiteEvent;
for (testSuiteEvent = testSuite.getNext(); testSuiteEvent != null; testSuiteEvent = testSuite.getNext()) {
if (testSuiteEvent.compareTo(SMEvent.START_ELEMENT) == 0) {
String testSuiteClassName = testSuite.getAttrValue("name");
parseTestCase(testSuiteClassName, testSuite.childCursor(new ElementFilter("testcase")));
}
}
}
use of org.codehaus.staxmate.in.ElementFilter in project sonar-python by SonarSource.
the class TestSuiteParser method stream.
@Override
public void stream(SMHierarchicCursor rootCursor) throws XMLStreamException {
SMInputCursor testSuiteCursor = rootCursor.constructDescendantCursor(new ElementFilter("testsuite"));
while (testSuiteCursor.getNext() != null) {
String testSuiteClassName = getExpectedAttribute(testSuiteCursor, "name");
TestSuite testSuite = new TestSuite(testSuiteClassName);
testSuites.add(testSuite);
SMInputCursor testCaseCursor = testSuiteCursor.childElementCursor("testcase");
while (testCaseCursor.getNext() != null) {
testSuite.addTestCase(parseTestCaseTag(testCaseCursor));
}
}
}
use of org.codehaus.staxmate.in.ElementFilter in project sonar-rust by elegoff.
the class TestSuiteParser method stream.
@Override
public void stream(SMHierarchicCursor rootCursor) throws XMLStreamException {
SMInputCursor testSuiteCursor = rootCursor.constructDescendantCursor(new ElementFilter("testsuite"));
while (testSuiteCursor.getNext() != null) {
String testSuiteClassName = getExpectedAttribute(testSuiteCursor, "name");
TestSuite testSuite = new TestSuite(testSuiteClassName);
testSuites.add(testSuite);
SMInputCursor testCaseCursor = testSuiteCursor.childElementCursor("testcase");
while (testCaseCursor.getNext() != null) {
testSuite.addTestCase(parseTestCaseTag(testCaseCursor));
}
}
}
Aggregations