Search in sources :

Example 1 with JUnit4StackTraceWriter

use of org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter in project ignite by apache.

the class IgniteTestsProvider method writeFailureToOutput.

/**
 * Make info about non-suited test visible to user.
 */
private void writeFailureToOutput(Failure failure) throws TestSetFailedException {
    try {
        SimpleReportEntry report = SimpleReportEntry.withException(failure.getDescription().getClassName(), null, failure.getDescription().getMethodName(), null, new JUnit4StackTraceWriter(failure));
        RunListener reporter = reporterFactory.createReporter();
        startCapture((ConsoleOutputReceiver) reporter);
        reporter.testFailed(report);
        reporter.testSetCompleted(report);
    } catch (Exception e) {
        throw new TestSetFailedException("Failed to dump exception to stdout");
    }
}
Also used : SimpleReportEntry(org.apache.maven.surefire.report.SimpleReportEntry) TestSetFailedException(org.apache.maven.surefire.testset.TestSetFailedException) TestSetFailedException(org.apache.maven.surefire.testset.TestSetFailedException) JUnit4StackTraceWriter(org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter) RunListener(org.apache.maven.surefire.report.RunListener)

Aggregations

JUnit4StackTraceWriter (org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter)1 RunListener (org.apache.maven.surefire.report.RunListener)1 SimpleReportEntry (org.apache.maven.surefire.report.SimpleReportEntry)1 TestSetFailedException (org.apache.maven.surefire.testset.TestSetFailedException)1