Search in sources :

Example 6 with SimpleReportEntry

use of org.apache.maven.surefire.report.SimpleReportEntry 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

SimpleReportEntry (org.apache.maven.surefire.report.SimpleReportEntry)6 Test (org.junit.jupiter.api.Test)5 EngineDescriptor (org.junit.platform.engine.support.descriptor.EngineDescriptor)4 ClassTestDescriptor (org.junit.jupiter.engine.descriptor.ClassTestDescriptor)3 TestMethodTestDescriptor (org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor)3 TestDescriptor (org.junit.platform.engine.TestDescriptor)3 AbstractTestDescriptor (org.junit.platform.engine.support.descriptor.AbstractTestDescriptor)3 TestPlan (org.junit.platform.launcher.TestPlan)3 InOrder (org.mockito.InOrder)3 RunListener (org.apache.maven.surefire.report.RunListener)2 JUnit4StackTraceWriter (org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter)1 ProviderParameters (org.apache.maven.surefire.providerapi.ProviderParameters)1 TestSetFailedException (org.apache.maven.surefire.testset.TestSetFailedException)1 Launcher (org.junit.platform.launcher.Launcher)1 TestExecutionSummary (org.junit.platform.launcher.listeners.TestExecutionSummary)1