use of org.sonar.scanner.deprecated.test.DefaultTestCase.Status in project sonarqube by SonarSource.
the class GenericTestExecutionReportParser method parseTestCase.
private static void parseTestCase(SMInputCursor cursor, DefaultTestPlan testPlan) throws XMLStreamException {
checkElementName(cursor, "testCase");
DefaultTestCase testCase = testPlan.addTestCase(mandatoryAttribute(cursor, NAME_ATTR));
Status status = Status.OK;
testCase.setDurationInMs(longValue(mandatoryAttribute(cursor, DURATION_ATTR), cursor, DURATION_ATTR, 0));
SMInputCursor child = cursor.descendantElementCursor();
if (child.getNext() != null) {
String elementName = child.getLocalName();
if (SKIPPED.equals(elementName)) {
status = Status.SKIPPED;
} else if (FAILURE.equals(elementName)) {
status = Status.FAILURE;
} else if (ERROR.equals(elementName)) {
status = Status.ERROR;
}
if (Status.OK != status) {
testCase.setMessage(mandatoryAttribute(child, MESSAGE_ATTR));
}
}
testCase.setStatus(status);
}
Aggregations