Skip to content

Commit 8445122

Browse files
committed
chore: extended plugin coverage
1 parent 8368269 commit 8445122

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ A simple plugin to check the presence of JUnit5 test by tags.
1010

1111
## Configuration reference
1212

13-
| parameter | type | required | notes |
14-
|--------------------------|---------|----------|------------------------------------------------------|
15-
| format | string | false | default 'text', accepts 'html', 'json', 'xml', 'pdf' |
16-
| outputFile | string | true | path where should be produced the report |
17-
| requiredTags.requiredTag | string | true | tag to be checked |
18-
| failOnMissingTag | boolean | true | if set to 'true' the build will fail on missing tags |
13+
| parameter | type | required | notes |
14+
|--------------------------|---------|----------|------------------------------------------------------------|
15+
| format | string | false | default 'txt', accepts 'html', 'json', 'xml', 'pdf', 'txt' |
16+
| outputFile | string | true | path where should be produced the report |
17+
| requiredTags.requiredTag | string | true | tag to be checked |
18+
| failOnMissingTag | boolean | true | if set to 'true' the build will fail on missing tags |
1919

2020
Here is a sample configuration
2121

src/test/java/org/fugerit/java/junit5/tag/check/ExecutedTestTagReporterMojoExtendedTest.java

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)