sormuras commented on a change in pull request #209: Surefire 1614
URL: https://github.com/apache/maven-surefire/pull/209#discussion_r241289930
##########
File path:
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
##########
@@ -104,22 +104,29 @@ public JUnitPlatformProvider( ProviderParameters
parameters )
public RunResult invoke( Object forkTestSet )
throws TestSetFailedException, ReporterException
{
+ ReporterFactory reporterFactory = parameters.getReporterFactory();
+ RunListener runListener = reporterFactory.createReporter();
+
+ ConsoleOutputCapture.startCapture( (ConsoleOutputReceiver) runListener
);
+
if ( forkTestSet instanceof TestsToRun )
{
- return invokeAllTests( (TestsToRun) forkTestSet );
+ invokeAllTests( (TestsToRun) forkTestSet, runListener );
}
else if ( forkTestSet instanceof Class )
{
- return invokeAllTests( TestsToRun.fromClass( (Class<?>)
forkTestSet ) );
+ invokeAllTests( TestsToRun.fromClass( (Class<?>) forkTestSet ),
runListener );
}
else if ( forkTestSet == null )
{
- return invokeAllTests( scanClasspath() );
+ invokeAllTests( scanClasspath(), runListener );
}
else
{
throw new IllegalArgumentException( "Unexpected value of
forkTestSet: " + forkTestSet );
}
+
+ return reporterFactory.close();
Review comment:
Wouldn't it swallow the `IllegalArgumentException`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services