use of com.intellij.execution.testframework.sm.runner.events.TestFailedEvent in project buck by facebook.
the class BuckToGeneralTestEventsConverter method consumeTestResultsAvailable.
@Override
public void consumeTestResultsAvailable(long timestamp, TestResults testResults) {
final GeneralTestEventsProcessor processor = getProcessor();
if (processor == null) {
return;
}
for (TestCaseSummary suite : testResults.getTestCases()) {
if (suite.getTestResults().isEmpty()) {
continue;
}
final String locationUrl = null;
processor.onSuiteStarted(new TestSuiteStartedEvent(suite.getTestCaseName(), locationUrl));
for (TestResultsSummary test : suite.getTestResults()) {
final String testName = test.getTestName();
processor.onTestStarted(new TestStartedEvent(testName, null));
final String stdOut = test.getStdOut();
if (stdOut != null) {
processor.onTestOutput(new TestOutputEvent(testName, stdOut, true));
}
final String stdErr = test.getStdErr();
if (stdErr != null) {
processor.onTestOutput(new TestOutputEvent(testName, stdErr, false));
}
if (test.getType() == ResultType.FAILURE) {
processor.onTestFailure(new TestFailedEvent(testName, "", test.getStacktrace(), true, null, null));
} else {
processor.onTestFinished(new TestFinishedEvent(testName, test.getTime()));
}
}
processor.onSuiteFinished(new TestSuiteFinishedEvent(suite.getTestCaseName()));
}
}
Aggregations