3434import org .apache .maven .plugin .surefire .extensions .SurefireStatelessReporter ;
3535import org .apache .maven .plugin .surefire .extensions .SurefireStatelessTestsetInfoReporter ;
3636import org .apache .maven .surefire .api .suite .RunResult ;
37+ import org .apache .maven .surefire .api .testset .RunOrderParameters ;
3738import org .apache .maven .surefire .api .util .DefaultScanResult ;
39+ import org .apache .maven .surefire .api .util .RunOrder ;
3840import org .apache .maven .surefire .api .util .SureFireFileManager ;
3941import org .apache .maven .surefire .extensions .ForkNodeFactory ;
4042import org .apache .maven .surefire .providerapi .ProviderInfo ;
5355 *
5456 */
5557public class MojoMocklessTest {
58+ @ Test
59+ public void testGetStartupReportConfigurationUsesProvidedRunStatisticsFile () throws Exception {
60+ AbstractSurefireMojo surefirePlugin = new Mojo (null , null );
61+ File runStatisticsFile = SureFireFileManager .createTempFile (".surefire-" , "checksum" );
62+ RunOrderParameters runOrderParameters = new RunOrderParameters (RunOrder .DEFAULT , runStatisticsFile );
63+ StartupReportConfiguration config = invokeMethod (
64+ surefirePlugin , "getStartupReportConfiguration" , false , mock (ProviderInfo .class ), runOrderParameters );
65+
66+ assertThat (config .getStatisticsFile ()).isSameAs (runStatisticsFile );
67+ }
68+
5669 @ Test
5770 public void testGetStartupReportConfiguration () throws Exception {
5871 AbstractSurefireMojo surefirePlugin = new Mojo (null , null );
59- StartupReportConfiguration config =
60- invokeMethod (surefirePlugin , "getStartupReportConfiguration" , false , mock (ProviderInfo .class ));
72+ RunOrderParameters runOrderParameters =
73+ new RunOrderParameters (RunOrder .DEFAULT , SureFireFileManager .createTempFile (".surefire-" , "checksum" ));
74+ StartupReportConfiguration config = invokeMethod (
75+ surefirePlugin , "getStartupReportConfiguration" , false , mock (ProviderInfo .class ), runOrderParameters );
6176
6277 assertThat (config .getXmlReporter ()).isNotNull ().isInstanceOf (SurefireStatelessReporter .class );
6378
@@ -69,15 +84,17 @@ public void testGetStartupReportConfiguration() throws Exception {
6984 @ Test
7085 public void testGetStartupReportConfiguration2 () throws Exception {
7186 AbstractSurefireMojo surefirePlugin = new Mojo (null , null );
87+ RunOrderParameters runOrderParameters =
88+ new RunOrderParameters (RunOrder .DEFAULT , SureFireFileManager .createTempFile (".surefire-" , "checksum" ));
7289 SurefireStatelessReporter xmlReporter = new SurefireStatelessReporter ();
7390 SurefireConsoleOutputReporter consoleReporter = new SurefireConsoleOutputReporter ();
7491 SurefireStatelessTestsetInfoReporter testsetInfoReporter = new SurefireStatelessTestsetInfoReporter ();
7592 setInternalState (surefirePlugin , "statelessTestsetReporter" , xmlReporter );
7693 setInternalState (surefirePlugin , "consoleOutputReporter" , consoleReporter );
7794 setInternalState (surefirePlugin , "statelessTestsetInfoReporter" , testsetInfoReporter );
7895
79- StartupReportConfiguration config =
80- invokeMethod ( surefirePlugin , "getStartupReportConfiguration" , false , mock (ProviderInfo .class ));
96+ StartupReportConfiguration config = invokeMethod (
97+ surefirePlugin , "getStartupReportConfiguration" , false , mock (ProviderInfo .class ), runOrderParameters );
8198
8299 assertThat (config .getXmlReporter ()).isNotNull ().isSameAs (xmlReporter );
83100
0 commit comments