@@ -19,31 +19,32 @@ class ExecutedTestTagReporterMojoExtendedTest {
1919
2020 @ Test
2121 void testExtended () throws MojoExecutionException {
22- String outputFormat = DocConfig .TYPE_HTML ;
23- for ( String id : Arrays .asList ( "sample-surefire-reports" , "sample-surefire-reports-failed" ,
24- "sample-surefire-reports-error" , "sample-surefire-reports-skipped" ) ) {
25- File reportFile = new File ( String .format ( "target/test-extended-%s.%s" , id , outputFormat ) );
26- log .info ( "output file delete : {}" , reportFile .delete () );
27- ExecutedTestTagReporterMojo mojo = new ExecutedTestTagReporterMojo () {
28- @ Override
29- public void execute () throws MojoExecutionException {
30- this .format = outputFormat ;
31- this .includeSkipped = Boolean .TRUE ;
32- this .failOnMissingTag = Boolean .FALSE ;
33- this .surefireReportsDirectory = new File ( String .format ( "src/test/resources/%s" , id ) );
34- this .outputFile = reportFile ;
35- this .project = new MavenProject ();
36- this .requiredTags = Arrays .asList ( "helper" , "not-found" );
37- this .includeSkipped = true ;
38- Build build = new Build ();
39- File testClassesDir = new File ( "target/test-classes" );
40- build .setTestOutputDirectory (testClassesDir .getAbsolutePath ());
41- project .setBuild (build );
42- super .execute ();
43- }
44- };
45- mojo .execute ();
46- assertTrue (reportFile .exists ());
22+ for ( String outputFormat : Arrays .asList ( DocConfig .TYPE_TXT , DocConfig .TYPE_HTML ) ) {
23+ for ( String id : Arrays .asList ( "sample-surefire-reports" , "sample-surefire-reports-failed" ,
24+ "sample-surefire-reports-error" , "sample-surefire-reports-skipped" ) ) {
25+ File reportFile = new File ( String .format ( "target/test-extended-%s.%s" , id , outputFormat ) );
26+ log .info ( "output file delete : {}" , reportFile .delete () );
27+ ExecutedTestTagReporterMojo mojo = new ExecutedTestTagReporterMojo () {
28+ @ Override
29+ public void execute () throws MojoExecutionException {
30+ this .format = outputFormat ;
31+ this .includeSkipped = Boolean .TRUE ;
32+ this .failOnMissingTag = Boolean .FALSE ;
33+ this .surefireReportsDirectory = new File ( String .format ( "src/test/resources/%s" , id ) );
34+ this .outputFile = reportFile ;
35+ this .project = new MavenProject ();
36+ this .requiredTags = Arrays .asList ( "helper" , "not-found" );
37+ this .includeSkipped = true ;
38+ Build build = new Build ();
39+ File testClassesDir = new File ( "target/test-classes" );
40+ build .setTestOutputDirectory (testClassesDir .getAbsolutePath ());
41+ project .setBuild (build );
42+ super .execute ();
43+ }
44+ };
45+ mojo .execute ();
46+ assertTrue (reportFile .exists ());
47+ }
4748 }
4849 }
4950
0 commit comments